Skip to content

Commit da5ddd5

Browse files
committed
docs: update content
1 parent 171eeeb commit da5ddd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1037
-552
lines changed

docs/content/components/accordion.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ other_frameworks: accordion
1616
The accordion uses [collapse]({{< docsref "/components/collapse" >}}) internally to make it collapsible. To render an accordion that's expanded, add the `.open` class on the `.accordion`.
1717

1818
{{< callout info >}}
19-
{{< partial "callout-info-prefersreducedmotion.md" >}}
19+
{{< partial "callouts/info-prefersreducedmotion.md" >}}
2020
{{< /callout >}}
2121

2222
## Example
@@ -26,36 +26,36 @@ Click the accordions below to expand/collapse the accordion content.
2626
{{< example >}}
2727
<div class="accordion" id="accordionExample">
2828
<div class="accordion-item">
29-
<h2 class="accordion-header" id="headingOne">
29+
<h2 class="accordion-header">
3030
<button class="accordion-button" type="button" data-coreui-toggle="collapse" data-coreui-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
3131
Accordion Item #1
3232
</button>
3333
</h2>
34-
<div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-coreui-parent="#accordionExample">
34+
<div id="collapseOne" class="accordion-collapse collapse show" data-coreui-parent="#accordionExample">
3535
<div class="accordion-body">
3636
<strong>This is the first item's accordion body.</strong> It is shown 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 <code>.accordion-body</code>, though the transition does limit overflow.
3737
</div>
3838
</div>
3939
</div>
4040
<div class="accordion-item">
41-
<h2 class="accordion-header" id="headingTwo">
41+
<h2 class="accordion-header">
4242
<button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse" data-coreui-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
4343
Accordion Item #2
4444
</button>
4545
</h2>
46-
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-coreui-parent="#accordionExample">
46+
<div id="collapseTwo" class="accordion-collapse collapse" data-coreui-parent="#accordionExample">
4747
<div class="accordion-body">
4848
<strong>This is the second item's accordion body.</strong> 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 <code>.accordion-body</code>, though the transition does limit overflow.
4949
</div>
5050
</div>
5151
</div>
5252
<div class="accordion-item">
53-
<h2 class="accordion-header" id="headingThree">
53+
<h2 class="accordion-header" i>
5454
<button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse" data-coreui-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
5555
Accordion Item #3
5656
</button>
5757
</h2>
58-
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-coreui-parent="#accordionExample">
58+
<div id="collapseThree" class="accordion-collapse collapse" data-coreui-parent="#accordionExample">
5959
<div class="accordion-body">
6060
<strong>This is the third item's accordion body.</strong> 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 <code>.accordion-body</code>, though the transition does limit overflow.
6161
</div>
@@ -68,35 +68,35 @@ Click the accordions below to expand/collapse the accordion content.
6868

6969
Add `.accordion-flush` to remove the default `background-color`, some borders, and some rounded corners to render accordions edge-to-edge with their parent container.
7070

71-
{{< example class="bg-light" >}}
71+
{{< example class="bg-body-secondary" >}}
7272
<div class="accordion accordion-flush" id="accordionFlushExample">
7373
<div class="accordion-item">
74-
<h2 class="accordion-header" id="flush-headingOne">
74+
<h2 class="accordion-header">
7575
<button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse" data-coreui-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
7676
Accordion Item #1
7777
</button>
7878
</h2>
79-
<div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-coreui-parent="#accordionFlushExample">
79+
<div id="flush-collapseOne" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
8080
<div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the first item's accordion body.</div>
8181
</div>
8282
</div>
8383
<div class="accordion-item">
84-
<h2 class="accordion-header" id="flush-headingTwo">
84+
<h2 class="accordion-header">
8585
<button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse" data-coreui-target="#flush-collapseTwo" aria-expanded="false" aria-controls="flush-collapseTwo">
8686
Accordion Item #2
8787
</button>
8888
</h2>
89-
<div id="flush-collapseTwo" class="accordion-collapse collapse" aria-labelledby="flush-headingTwo" data-coreui-parent="#accordionFlushExample">
89+
<div id="flush-collapseTwo" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
9090
<div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the second item's accordion body. Let's imagine this being filled with some actual content.</div>
9191
</div>
9292
</div>
9393
<div class="accordion-item">
94-
<h2 class="accordion-header" id="flush-headingThree">
94+
<h2 class="accordion-header">
9595
<button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse" data-coreui-target="#flush-collapseThree" aria-expanded="false" aria-controls="flush-collapseThree">
9696
Accordion Item #3
9797
</button>
9898
</h2>
99-
<div id="flush-collapseThree" class="accordion-collapse collapse" aria-labelledby="flush-headingThree" data-coreui-parent="#accordionFlushExample">
99+
<div id="flush-collapseThree" class="accordion-collapse collapse" data-coreui-parent="#accordionFlushExample">
100100
<div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.</div>
101101
</div>
102102
</div>
@@ -110,36 +110,36 @@ Omit the `data-coreui-parent` attribute on each `.accordion-collapse` to make ac
110110
{{< example >}}
111111
<div class="accordion" id="accordionPanelsStayOpenExample">
112112
<div class="accordion-item">
113-
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
113+
<h2 class="accordion-header">
114114
<button class="accordion-button" type="button" data-coreui-toggle="collapse" data-coreui-target="#panelsStayOpen-collapseOne" aria-expanded="true" aria-controls="panelsStayOpen-collapseOne">
115115
Accordion Item #1
116116
</button>
117117
</h2>
118-
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show" aria-labelledby="panelsStayOpen-headingOne">
118+
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show">
119119
<div class="accordion-body">
120120
<strong>This is the first item's accordion body.</strong> It is shown 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 <code>.accordion-body</code>, though the transition does limit overflow.
121121
</div>
122122
</div>
123123
</div>
124124
<div class="accordion-item">
125-
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
125+
<h2 class="accordion-header">
126126
<button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse" data-coreui-target="#panelsStayOpen-collapseTwo" aria-expanded="false" aria-controls="panelsStayOpen-collapseTwo">
127127
Accordion Item #2
128128
</button>
129129
</h2>
130-
<div id="panelsStayOpen-collapseTwo" class="accordion-collapse collapse" aria-labelledby="panelsStayOpen-headingTwo">
130+
<div id="panelsStayOpen-collapseTwo" class="accordion-collapse collapse">
131131
<div class="accordion-body">
132132
<strong>This is the second item's accordion body.</strong> 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 <code>.accordion-body</code>, though the transition does limit overflow.
133133
</div>
134134
</div>
135135
</div>
136136
<div class="accordion-item">
137-
<h2 class="accordion-header" id="panelsStayOpen-headingThree">
137+
<h2 class="accordion-header">
138138
<button class="accordion-button collapsed" type="button" data-coreui-toggle="collapse" data-coreui-target="#panelsStayOpen-collapseThree" aria-expanded="false" aria-controls="panelsStayOpen-collapseThree">
139139
Accordion Item #3
140140
</button>
141141
</h2>
142-
<div id="panelsStayOpen-collapseThree" class="accordion-collapse collapse" aria-labelledby="panelsStayOpen-headingThree">
142+
<div id="panelsStayOpen-collapseThree" class="accordion-collapse collapse">
143143
<div class="accordion-body">
144144
<strong>This is the third item's accordion body.</strong> 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 <code>.accordion-body</code>, though the transition does limit overflow.
145145
</div>

docs/content/components/alerts.md

Lines changed: 6 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Bootstrap alert is prepared for any length of text, as well as an optional close
2323
{{< /example >}}
2424

2525
{{< callout info >}}
26-
{{< partial "callout-warning-color-assistive-technologies.md" >}}
26+
{{< partial "callouts/warning-color-assistive-technologies.md" >}}
2727
{{< /callout >}}
2828

2929
### Live example
@@ -37,28 +37,7 @@ Click the button below to show an alert (hidden with inline styles to start), th
3737

3838
We use the following JavaScript to trigger our live alert demo:
3939

40-
```js
41-
const alertPlaceholder = document.getElementById('liveAlertPlaceholder')
42-
43-
const alert = (message, type) => {
44-
const wrapper = document.createElement('div')
45-
wrapper.innerHTML = [
46-
`<div class="alert alert-${type} alert-dismissible" role="alert">`,
47-
` <div>${message}</div>`,
48-
' <button type="button" class="btn-close" data-cui-dismiss="alert" aria-label="Close"></button>',
49-
'</div>'
50-
].join('')
51-
52-
alertPlaceholder.append(wrapper)
53-
}
54-
55-
const alertTrigger = document.getElementById('liveAlertBtn')
56-
if (alertTrigger) {
57-
alertTrigger.addEventListener('click', () => {
58-
alert('Nice, you triggered this alert message!', 'success')
59-
})
60-
}
61-
```
40+
{{< js-docs name="live-alert" file="docs/assets/js/snippets.js" >}}
6241

6342
### Link color
6443

@@ -104,7 +83,7 @@ Similarly, you can use [flexbox utilities]({{< docsref "/utilities/flex" >}}) an
10483
Need more than one icon for your alerts? Consider using more Bootstrap Icons and making a local SVG sprite like so to easily reference the same icons repeatedly.
10584

10685
{{< example >}}
107-
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
86+
<svg xmlns="http://www.w3.org/2000/svg" class="d-none">
10887
<symbol id="check-circle-fill" viewBox="0 0 16 16">
10988
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
11089
</symbol>
@@ -235,7 +214,7 @@ myAlert.addEventListener('closed.coreui.alert', event => {
235214

236215
## Customizing
237216

238-
### CSS Variables
217+
### CSS variables
239218

240219
Alerts use local CSS variables on `.alert` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
241220

@@ -245,43 +224,10 @@ Alerts use local CSS variables on `.alert` for enhanced real-time customization.
245224

246225
{{< scss-docs name="alert-variables" file="scss/_variables.scss" >}}
247226

248-
### SASS variants
249-
250-
CoreUI allows defining variant colors in two ways.
251-
252-
Check out [our Sass maps and loops docs]({{< docsref "/customize/sass#maps-and-loops" >}}) for how to customize these loops and extend CoreUI's base-modifier approach to your own code.
253-
254-
#### Manual
255-
256-
You can define each color manually and keep full control of the component appearance.
257-
258-
{{< highlight scss >}}
259-
$alert-variants: (
260-
"primary": (
261-
"background": $your-bg-color,
262-
"border": $your-border-color,
263-
"color": $your-color,
264-
"link-color": $your-link-color
265-
)
266-
...
267-
);
268-
{{< /highlight >}}
269-
270-
#### Color function
271-
272-
The color set can be generated automatically thanks to our `alert-color-map` function.
273-
274-
{{< scss-docs name="alert-color-functions" file="scss/_functions.scss" >}}
275-
276-
{{< highlight scss >}}
277-
$alert-variants: (
278-
"primary": alert-color-map($primary),
279-
...
280-
);
281-
{{< /highlight >}}
282-
283227
### SASS mixin
284228

229+
{{< deprecated-in "4.3.0" >}}
230+
285231
Used in combination with `$alert-variants` to create contextual modifier classes for our alerts.
286232

287233
{{< scss-docs name="alert-variant-mixin" file="scss/mixins/_alert.scss" >}}
@@ -290,6 +236,4 @@ Used in combination with `$alert-variants` to create contextual modifier classes
290236

291237
Loop that generates the modifier classes with the `alert-variant()` mixin.
292238

293-
{{< scss-docs name="alert-variants" file="scss/_variables.scss" >}}
294-
295239
{{< scss-docs name="alert-modifiers" file="scss/_alert.scss" >}}

docs/content/components/avatar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ Fancy larger or smaller avatar? Add .avatar-lg or .avatar-sm for additional size
116116

117117
## Customizing
118118

119-
### SASS Variables
119+
### SASS variables
120120

121121
{{< scss-docs name="avatar-variables" file="scss/_variables.scss" >}}

docs/content/components/badge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Add any of the below-mentioned classes to modify the presentation of a badge. Pl
7777
{{< /example >}}
7878

7979
{{< callout info >}}
80-
{{< partial "callout-warning-color-assistive-technologies.md" >}}
80+
{{< partial "callouts/warning-color-assistive-technologies.md" >}}
8181
{{< /callout >}}
8282

8383
## Pill badges
@@ -93,7 +93,7 @@ Apply the `.rounded-pill` modifier class to make badges rounded.
9393

9494
## Customizing
9595

96-
### CSS Variables
96+
### CSS variables
9797

9898
Badges use local CSS variables on `.badge` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
9999

docs/content/components/breadcrumb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Inlining SVG as data URI requires to URL escape a few characters, most notably `
6767
{{< /callout >}}
6868

6969
{{< example >}}
70-
<nav style="--cui-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='currentColor'/%3E%3C/svg%3E&#34;);" aria-label="breadcrumb">
70+
<nav style="--cui-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%236c757d'/%3E%3C/svg%3E&#34;);" aria-label="breadcrumb">
7171
<ol class="breadcrumb">
7272
<li class="breadcrumb-item"><a href="#">Home</a></li>
7373
<li class="breadcrumb-item active" aria-current="page">Library</li>
@@ -103,7 +103,7 @@ For more information, see the [ARIA Authoring Practices Guide breadcrumb pattern
103103

104104
## Customizing
105105

106-
### CSS Variables
106+
### CSS variables
107107

108108
Breadcrumbs use local CSS variables on `.breadcrumb` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
109109

0 commit comments

Comments
 (0)