Skip to content

Commit 0a09e4d

Browse files
committed
refactor: add descriptions and examples
1 parent 95eb0c1 commit 0a09e4d

22 files changed

+2640
-377
lines changed

src/pug/_layout/default.pug

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
- var static = true
22
doctype html
33
include ../_partials/banner.pug
4+
include ../_mixins/callout.pug
5+
include ../_mixins/example.pug
46

57
html(lang='en')
68
head
79
base(href=base)
810
include ../_partials/head.pug
11+
block canonical
912
block styles
1013
body
1114
include ../_partials/sidebar.pug

src/pug/_mixins/callout.pug

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
mixin callout(name, href)
2+
.callout.callout-info.bg-white
3+
| CoreUI #{name} Component has been created as an extension of Bootstrap #{name}. CoreUI #{name} is delivered with some new features, variants, and unique design that matches CoreUI Design System requirements.
4+
br
5+
br
6+
| For more information please visit our official
7+
|
8+
a(href=href target="_blank") documentation
9+
| .

src/pug/_mixins/example.pug

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
mixin example
2+
- var id = Math.floor(Math.random() * (15 - 1300) + 1300)
3+
.example.mt-4
4+
ul.nav.nav-tabs(role="tablist")
5+
li.nav-item
6+
a.nav-link.active(data-coreui-toggle="tab" href="#preview-"+id role="tab")
7+
svg.icon.me-2
8+
use(xlink:href="node_modules/@coreui/icons/sprites/free.svg#cil-media-play")
9+
| Preview
10+
11+
li.nav-item
12+
a.nav-link(data-coreui-toggle="tab" href="#code-"+id role="tab")
13+
svg.icon.me-2
14+
use(xlink:href="node_modules/@coreui/icons/sprites/free.svg#cil-code")
15+
| Code
16+
.tab-content
17+
.tab-pane.py-3.active(role="tabpanel" id="preview-"+id )
18+
block
19+
.tab-pane.py-3(role="tabpanel" id="code-"+id )
20+
script.language-html(type='text/plain')
21+
block

src/pug/_partials/head.pug

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ meta(name='msapplication-TileColor', content='#ffffff')
2424
meta(name='msapplication-TileImage', content='assets/favicon/ms-icon-144x144.png')
2525
meta(name='theme-color', content='#ffffff')
2626

27+
link(rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/themes/prism.css')
28+
2729
// Main styles for this application
2830
link(href='css/style.css', rel='stylesheet')
2931

32+
3033
// Global site tag (gtag.js) - Google Analytics
3134
script(async='', src='https://www.googletagmanager.com/gtag/js?id=UA-118965717-3')
3235
script.

src/pug/_partials/scripts.pug

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
// CoreUI and necessary plugins
22
script(src='node_modules/@coreui/coreui/dist/js/coreui.bundle.min.js')
3+
script(src='https://cdn.jsdelivr.net/npm/[email protected]/prism.js')
4+
script(src='https://cdn.jsdelivr.net/npm/[email protected]/plugins/autoloader/prism-autoloader.min.js')
5+
script(src='https://cdn.jsdelivr.net/npm/[email protected]/plugins/unescaped-markup/prism-unescaped-markup.min.js')
6+
script(src='https://cdn.jsdelivr.net/npm/[email protected]/plugins/normalize-whitespace/prism-normalize-whitespace.js')
37

4-
block scripts
8+
script(type='text/javascript').
9+
// Optional
10+
Prism.plugins.NormalizeWhitespace.setDefaults({
11+
'remove-trailing': true,
12+
'remove-indent': true,
13+
'left-trim': true,
14+
'right-trim': true,
15+
//- 'break-lines': 60,
16+
});
17+
18+
script(src='https://cdn.jsdelivr.net/npm/[email protected]/dist/masonry.pkgd.min.js' integrity='sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D' crossorigin='anonymous' async)
519

20+
block scripts

src/pug/_partials/sidebar.pug

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,36 @@
114114
svg.nav-icon
115115
use(xlink:href="node_modules/@coreui/icons/sprites/free.svg#cil-chart-pie")
116116
| Charts
117+
li.nav-group
118+
a.nav-link.nav-group-toggle(href='#')
119+
svg.nav-icon
120+
use(xlink:href="node_modules/@coreui/icons/sprites/free.svg#cil-notes")
121+
| Forms
122+
ul.nav-group-items
123+
li.nav-item
124+
a.nav-link(href='forms/form-control.html')
125+
| Form Control
126+
li.nav-item
127+
a.nav-link(href='forms/select.html')
128+
| Select
129+
li.nav-item
130+
a.nav-link(href='forms/checks-radios.html')
131+
| Checks and radios
132+
li.nav-item
133+
a.nav-link(href='forms/range.html')
134+
| Range
135+
li.nav-item
136+
a.nav-link(href='forms/input-group.html')
137+
| Input group
138+
li.nav-item
139+
a.nav-link(href='forms/floating-labels.html')
140+
| Floating labels
141+
li.nav-item
142+
a.nav-link(href='forms/layout.html')
143+
| Layout
144+
li.nav-item
145+
a.nav-link(href='forms/validation.html')
146+
| Validation
117147
li.nav-group
118148
a.nav-link.nav-group-toggle(href='#')
119149
svg.nav-icon

src/pug/views/base/accordion.pug

Lines changed: 69 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,84 @@
11
extends ../../_layout/default.pug
22

3+
block canonical
4+
link(rel='canonical' href='https://coreui.io/docs/4.0/components/accordion/')
5+
36
block view
7+
+callout('Accordion', 'https://coreui.io/docs/4.0/components/accordion/')
48
.row
59
.col-12.col-md-6
610
.card.mb-4
711
.card-header
812
| Accordion
913
.card-body
10-
#accordionExample.accordion
11-
.accordion-item
12-
h2#headingOne.accordion-header
13-
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#collapseOne' aria-expanded='false' aria-controls='collapseOne')
14-
| Accordion Item #1
15-
#collapseOne.accordion-collapse.collapse(aria-labelledby='headingOne' data-coreui-parent='#accordionExample' style='')
16-
.accordion-body
17-
strong This is the first item's accordion body.
18-
| It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the
19-
code .accordion-body
20-
| , though the transition does limit overflow.
21-
.accordion-item
22-
h2#headingTwo.accordion-header
23-
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#collapseTwo' aria-expanded='false' aria-controls='collapseTwo')
24-
| Accordion Item #2
25-
#collapseTwo.accordion-collapse.collapse(aria-labelledby='headingTwo' data-coreui-parent='#accordionExample' style='')
26-
.accordion-body
27-
strong This is the second item's accordion body.
28-
| It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the
29-
code .accordion-body
30-
| , though the transition does limit overflow.
31-
.accordion-item
32-
h2#headingThree.accordion-header
33-
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#collapseThree' aria-expanded='false' aria-controls='collapseThree')
34-
| Accordion Item #3
35-
#collapseThree.accordion-collapse.collapse(aria-labelledby='headingThree' data-coreui-parent='#accordionExample' style='')
36-
.accordion-body
37-
strong This is the third item's accordion body.
38-
| It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the
39-
code .accordion-body
40-
| , though the transition does limit overflow.
14+
p
15+
| Click the accordions below to expand/collapse the accordion content.
16+
hr
17+
+example()
18+
#accordionExample.accordion
19+
.accordion-item
20+
h2#headingOne.accordion-header
21+
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#collapseOne' aria-expanded='false' aria-controls='collapseOne')
22+
| Accordion Item #1
23+
#collapseOne.accordion-collapse.collapse(aria-labelledby='headingOne' data-coreui-parent='#accordionExample' style='')
24+
.accordion-body
25+
strong This is the first item's accordion body.
26+
| It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the
27+
code .accordion-body
28+
| , though the transition does limit overflow.
29+
.accordion-item
30+
h2#headingTwo.accordion-header
31+
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#collapseTwo' aria-expanded='false' aria-controls='collapseTwo')
32+
| Accordion Item #2
33+
#collapseTwo.accordion-collapse.collapse(aria-labelledby='headingTwo' data-coreui-parent='#accordionExample' style='')
34+
.accordion-body
35+
strong This is the second item's accordion body.
36+
| It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the
37+
code .accordion-body
38+
| , though the transition does limit overflow.
39+
.accordion-item
40+
h2#headingThree.accordion-header
41+
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#collapseThree' aria-expanded='false' aria-controls='collapseThree')
42+
| Accordion Item #3
43+
#collapseThree.accordion-collapse.collapse(aria-labelledby='headingThree' data-coreui-parent='#accordionExample' style='')
44+
.accordion-body
45+
strong This is the third item's accordion body.
46+
| It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the
47+
code .accordion-body
48+
| , though the transition does limit overflow.
4149
.col-12.col-md-6
4250
.card.mb-4
4351
.card-header
4452
| Accordion
4553
span.small.ms-1 Flush
4654
.card-body
47-
#accordionFlushExample.accordion.accordion-flush
48-
.accordion-item
49-
h2#flush-headingOne.accordion-header
50-
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#flush-collapseOne' aria-expanded='false' aria-controls='flush-collapseOne')
51-
| Accordion Item #1
52-
#flush-collapseOne.accordion-collapse.collapse(aria-labelledby='flush-headingOne' data-coreui-parent='#accordionFlushExample')
53-
.accordion-body
54-
| Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
55-
.accordion-item
56-
h2#flush-headingTwo.accordion-header
57-
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#flush-collapseTwo' aria-expanded='false' aria-controls='flush-collapseTwo')
58-
| Accordion Item #2
59-
#flush-collapseTwo.accordion-collapse.collapse(aria-labelledby='flush-headingTwo' data-coreui-parent='#accordionFlushExample')
60-
.accordion-body
61-
| Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
62-
.accordion-item
63-
h2#flush-headingThree.accordion-header
64-
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#flush-collapseThree' aria-expanded='false' aria-controls='flush-collapseThree')
65-
| Accordion Item #3
66-
#flush-collapseThree.accordion-collapse.collapse(aria-labelledby='flush-headingThree' data-coreui-parent='#accordionFlushExample')
67-
.accordion-body
68-
| Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
55+
p
56+
| Add
57+
code .accordion-flush
58+
| to remove the default
59+
code background-color
60+
| , some borders, and some rounded corners to render accordions edge-to-edge with their parent container.
61+
hr
62+
+example()
63+
#accordionFlushExample.accordion.accordion-flush
64+
.accordion-item
65+
h2#flush-headingOne.accordion-header
66+
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#flush-collapseOne' aria-expanded='false' aria-controls='flush-collapseOne')
67+
| Accordion Item #1
68+
#flush-collapseOne.accordion-collapse.collapse(aria-labelledby='flush-headingOne' data-coreui-parent='#accordionFlushExample')
69+
.accordion-body
70+
| Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
71+
.accordion-item
72+
h2#flush-headingTwo.accordion-header
73+
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#flush-collapseTwo' aria-expanded='false' aria-controls='flush-collapseTwo')
74+
| Accordion Item #2
75+
#flush-collapseTwo.accordion-collapse.collapse(aria-labelledby='flush-headingTwo' data-coreui-parent='#accordionFlushExample')
76+
.accordion-body
77+
| Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
78+
.accordion-item
79+
h2#flush-headingThree.accordion-header
80+
button.accordion-button.collapsed(type='button' data-coreui-toggle='collapse' data-coreui-target='#flush-collapseThree' aria-expanded='false' aria-controls='flush-collapseThree')
81+
| Accordion Item #3
82+
#flush-collapseThree.accordion-collapse.collapse(aria-labelledby='flush-headingThree' data-coreui-parent='#accordionFlushExample')
83+
.accordion-body
84+
| Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

0 commit comments

Comments
 (0)