refactor: update examples

This commit is contained in:
mrholek
2023-11-07 16:04:34 +01:00
parent 3e9b26da00
commit 0eb3fcda89
6 changed files with 20 additions and 17 deletions
+7 -7
View File
@@ -1,9 +1,10 @@
<template> <template>
<div class="example"> <div class="example">
<CNav variant="tabs"> <CNav variant="underline-border">
<CNavItem> <CNavItem>
<CNavLink href="#" active> <CNavLink href="#" active>
<CIcon icon="cil-media-play" class="me-2" /> <CIcon icon="cil-media-play" class="me-2" />
Preview
</CNavLink> </CNavLink>
</CNavItem> </CNavItem>
<CNavItem> <CNavItem>
@@ -13,7 +14,7 @@
</CNavLink> </CNavLink>
</CNavItem> </CNavItem>
</CNav> </CNav>
<CTabContent class="rounded-bottom"> <CTabContent :class="['rounded-bottom', addClass]">
<CTabPane class="p-3 preview" visible> <CTabPane class="p-3 preview" visible>
<slot></slot> <slot></slot>
</CTabPane> </CTabPane>
@@ -25,16 +26,15 @@
export default { export default {
name: 'DocsExample', name: 'DocsExample',
props: { props: {
href: { href: String,
type: String, tabContentClass: String,
default: undefined,
required: false,
},
}, },
setup(props) { setup(props) {
const url = `https://coreui.io/vue/docs/${props.href}` const url = `https://coreui.io/vue/docs/${props.href}`
const addClass = props.tabContentClass
return { return {
addClass,
url, url,
} }
}, },
+4 -1
View File
@@ -9,7 +9,7 @@
} }
.tab-content { .tab-content {
background-color: var(--#{$prefix}tertiary-bg) !important; background-color: var(--#{$prefix}tertiary-bg);
} }
& + p { & + p {
@@ -51,6 +51,9 @@
} }
// Buttons // Buttons
.col > .btn,
.col-auto > .btn,
.d-md-block > .btn,
> .btn, > .btn,
> .btn-group { > .btn-group {
margin: .25rem .125rem; margin: .25rem .125rem;
+1 -1
View File
@@ -447,7 +447,7 @@
</CTable> </CTable>
</DocsExample> </DocsExample>
<p class="text-body-secondary small"> <p class="text-body-secondary small">
<a href="https://coreui.io/docs/4.0/utilities/borders#border-color"> <a href="https://coreui.io/docs/utilities/borders#border-color">
Border color utilities Border color utilities
</a> </a>
can be added to change colors: can be added to change colors:
+1 -1
View File
@@ -59,7 +59,7 @@
<CCardBody> <CCardBody>
<p class="text-body-secondary small"> <p class="text-body-secondary small">
You can combine button with our You can combine button with our
<a href="https://icons.coreui.io/">CoreUI Icons</a>. <a href="https://coreui.io/icons/">CoreUI Icons</a>.
</p> </p>
<DocsExample href="components/button.html"> <DocsExample href="components/button.html">
<template <template
+1 -1
View File
@@ -12,7 +12,7 @@
<strong>required</strong> contextual <code>color</code> props (e.g., <strong>required</strong> contextual <code>color</code> props (e.g.,
<code>primary</code>). For inline dismissal, use the <code>primary</code>). For inline dismissal, use the
<a <a
href="https://coreui.io/vue/docs/4.0/components/alert.html#dismissing" href="https://coreui.io/vue/docs/components/alert.html#dismissing"
> >
dismissing prop dismissing prop
</a> </a>
+5 -5
View File
@@ -133,11 +133,11 @@
<CCardBody> <CCardBody>
<p class="text-body-secondary small"> <p class="text-body-secondary small">
Customize your toasts by removing sub-components, tweaking them with Customize your toasts by removing sub-components, tweaking them with
<a href="https://coreui.io/docs/4.0/utilities/api">utilities</a>, or by adding your own <a href="https://coreui.io/docs/utilities/api">utilities</a>, or by adding your own
markup. Here we&#39;ve created a simpler toast by removing the default markup. Here we&#39;ve created a simpler toast by removing the default
<code>&lt;CToastHeader&gt;</code>, adding a custom hide icon from <code>&lt;CToastHeader&gt;</code>, adding a custom hide icon from
<a href="https://icons.coreui.io">CoreUI Icons</a>, and using some <a href="https://coreui.io/icons/">CoreUI Icons</a>, and using some
<a href="https://coreui.io/docs/4.0/utilities/flex">flexbox utilities</a> to adjust the <a href="https://coreui.io/docs/utilities/flex">flexbox utilities</a> to adjust the
layout. layout.
</p> </p>
<DocsExample href="components/toast.html#custom-content"> <DocsExample href="components/toast.html#custom-content">
@@ -173,8 +173,8 @@
<CCardBody> <CCardBody>
<p class="text-body-secondary small"> <p class="text-body-secondary small">
Building on the above example, you can create different toast color schemes with our Building on the above example, you can create different toast color schemes with our
<a href="https://coreui.io/docs/4.0/utilities/colors">color</a> and <a href="https://coreui.io/docs/utilities/colors">color</a> and
<a href="https://coreui.io/docs/4.0//utilities/background">background</a> utilities. <a href="https://coreui.io/docs//utilities/background">background</a> utilities.
Here we&#39;ve set <code>color=&#34;primary&#34;</code> and added Here we&#39;ve set <code>color=&#34;primary&#34;</code> and added
<code>.text-white</code> class to the <code>&lt;Ctoast&gt;</code>, and then set <code>.text-white</code> class to the <code>&lt;Ctoast&gt;</code>, and then set
<code>white</code> property to our close button. For a crisp edge, we remove the default <code>white</code> property to our close button. For a crisp edge, we remove the default