Skip to content

Commit db30ab5

Browse files
committed
refactor: update examples
1 parent ed99a1f commit db30ab5

File tree

4 files changed

+114
-129
lines changed

4 files changed

+114
-129
lines changed

src/pug/_mixins/example.pug

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
mixin example(url)
2-
1+
mixin example(url, classNames)
32
.example
43
ul.nav.nav-underline-border(role="tablist")
54
li.nav-item
@@ -15,6 +14,6 @@ mixin example(url)
1514
use(xlink:href="node_modules/@coreui/icons/sprites/free.svg#cil-code")
1615
|
1716
| Code
18-
.tab-content.rounded-bottom
17+
.tab-content.rounded-bottom(class=classNames)
1918
.tab-pane.p-3.active.preview(role="tabpanel" id="preview-"+count++ )
2019
block

src/pug/views/notifications/toasts.pug

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ block scripts
88
script(src='js/toasts.js')
99

1010
block breadcrumb
11-
+breadcrumb(['Home', 'Components', 'Notifications'], 'Toasts')
11+
+breadcrumb(
12+
[
13+
{ href: '#', label: 'Home'},
14+
{ label: 'Components'},
15+
{ label: 'Notifications'},
16+
'Toasts'
17+
]
18+
)
1219

1320
block view
14-
1521
.card.mb-4
1622
.card-header
1723
strong Toast
@@ -20,16 +26,15 @@ block view
2026
p.text-body-secondary.small
2127
| Toasts are as flexible as you need and have very little required markup. At a minimum, we require a single element to contain your “toasted” content and strongly encourage a dismiss button.
2228
+example('https://coreui.io/docs/components/toasts/#basic')
23-
.bg-light.p-3
24-
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
25-
.toast-header
26-
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
27-
rect(width='100%' height='100%' fill='#007aff')
28-
strong.me-auto Bootstrap
29-
small 11 mins ago
30-
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
31-
.toast-body
32-
| Hello, world! This is a toast message.
29+
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
30+
.toast-header
31+
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
32+
rect(width='100%' height='100%' fill='#007aff')
33+
strong.me-auto Bootstrap
34+
small 11 mins ago
35+
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
36+
.toast-body
37+
| Hello, world! This is a toast message.
3338
.card.mb-4
3439
.card-header
3540
strong Toast
@@ -58,17 +63,16 @@ block view
5863
.card-body
5964
p.text-body-secondary.small
6065
| Toasts are slightly translucent, too, so they blend over whatever they might appear over.
61-
+example('https://coreui.io/docs/components/toasts/#translucent')
62-
.bg-dark.p-3
63-
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
64-
.toast-header
65-
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
66-
rect(width='100%' height='100%' fill='#007aff')
67-
strong.me-auto Bootstrap
68-
small.text-body-secondary 11 mins ago
69-
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
70-
.toast-body
71-
| Hello, world! This is a toast message.
66+
+example('https://coreui.io/docs/components/toasts/#translucent', 'bg-dark')
67+
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
68+
.toast-header
69+
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
70+
rect(width='100%' height='100%' fill='#007aff')
71+
strong.me-auto Bootstrap
72+
small.text-body-secondary 11 mins ago
73+
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
74+
.toast-body
75+
| Hello, world! This is a toast message.
7276
.card.mb-4
7377
.card-header
7478
strong Toast
@@ -77,26 +81,25 @@ block view
7781
p.text-body-secondary.small
7882
| You can stack toasts by wrapping them in a toast container, which will vertically add some spacing.
7983
+example('https://coreui.io/docs/components/toasts/#stacking')
80-
.bg-light.p-3
81-
.toast-container
82-
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
83-
.toast-header
84-
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
85-
rect(width='100%' height='100%' fill='#007aff')
86-
strong.me-auto Bootstrap
87-
small.text-body-secondary just now
88-
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
89-
.toast-body
90-
| See? Just like this.
91-
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
92-
.toast-header
93-
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
94-
rect(width='100%' height='100%' fill='#007aff')
95-
strong.me-auto Bootstrap
96-
small.text-body-secondary 2 seconds ago
97-
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
98-
.toast-body
99-
| Heads up, toasts will stack automatically
84+
.toast-container.position-static
85+
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
86+
.toast-header
87+
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
88+
rect(width='100%' height='100%' fill='#007aff')
89+
strong.me-auto Bootstrap
90+
small.text-body-secondary just now
91+
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
92+
.toast-body
93+
| See? Just like this.
94+
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
95+
.toast-header
96+
svg.docs-placeholder-img.rounded.me-2(width='20' height='20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' preserveAspectRatio='xMidYMid slice' focusable='false')
97+
rect(width='100%' height='100%' fill='#007aff')
98+
strong.me-auto Bootstrap
99+
small.text-body-secondary 2 seconds ago
100+
button.btn-close(type='button' data-coreui-dismiss='toast' aria-label='Close')
101+
.toast-body
102+
| Heads up, toasts will stack automatically
100103
.card.mb-4
101104
.card-header
102105
strong Toast
@@ -113,21 +116,19 @@ block view
113116
a(href='https://coreui.io/docs/utilities/flex/') flexbox utilities
114117
| to adjust the layout.
115118
+example('https://coreui.io/docs/components/toasts/#custom-content')
116-
.bg-light.p-3
117-
.toast.align-items-center.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
118-
.d-flex
119-
.toast-body
120-
| Hello, world! This is a toast message.
121-
button.btn-close.me-2.m-auto(type='button' data-coreui-dismiss='toast' aria-label='Close')
122-
p.text-body-secondary.small Alternatively, you can also add additional controls and components to toasts.
123-
+example('https://coreui.io/docs/components/toasts/#custom-content')
124-
.bg-light.p-3
125-
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
119+
.toast.align-items-center.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
120+
.d-flex
126121
.toast-body
127122
| Hello, world! This is a toast message.
128-
.mt-2.pt-2.border-top
129-
button.btn.btn-primary.btn-sm(type='button') Take action
130-
button.btn.btn-secondary.btn-sm(type='button' data-coreui-dismiss='toast') Close
123+
button.btn-close.me-2.m-auto(type='button' data-coreui-dismiss='toast' aria-label='Close')
124+
p.text-body-secondary.small Alternatively, you can also add additional controls and components to toasts.
125+
+example('https://coreui.io/docs/components/toasts/#custom-content')
126+
.toast.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
127+
.toast-body
128+
| Hello, world! This is a toast message.
129+
.mt-2.pt-2.border-top
130+
button.btn.btn-primary.btn-sm(type='button') Take action
131+
button.btn.btn-secondary.btn-sm(type='button' data-coreui-dismiss='toast') Close
131132
.card.mb-4
132133
.card-header
133134
strong Toast
@@ -150,10 +151,9 @@ block view
150151
code .border-0
151152
| .
152153
+example('https://coreui.io/docs/components/toasts/#color-schemes')
153-
.bg-light.p-3
154-
.toast.align-items-center.text-white.bg-primary.border-0.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
155-
.d-flex
156-
.toast-body
157-
| Hello, world! This is a toast message.
158-
button.btn-close.btn-close-white.me-2.m-auto(type='button' data-coreui-dismiss='toast' aria-label='Close')
154+
.toast.align-items-center.text-white.bg-primary.border-0.fade.show(role='alert' aria-live='assertive' aria-atomic='true')
155+
.d-flex
156+
.toast-body
157+
| Hello, world! This is a toast message.
158+
button.btn-close.btn-close-white.me-2.m-auto(type='button' data-coreui-dismiss='toast' aria-label='Close')
159159

src/scss/examples.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
.tab-content {
12-
background-color: var(--#{$prefix}tertiary-bg) !important;
12+
background-color: var(--#{$prefix}tertiary-bg);
1313
}
1414

1515
& + p {

0 commit comments

Comments
 (0)