Skip to content

Commit cfd3e35

Browse files
committed
Merge branch 'main' of https://github.com/coreui/coreui
2 parents a60e276 + f20a806 commit cfd3e35

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/content/components/placeholders.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@ other_frameworks: placeholder
1414

1515
## About
1616

17-
Placeholders can be used to enhance the experience of your application. They're built only with HTML and CSS, meaning you don't need any JavaScript to create them. You will, however, need some custom JavaScript to toggle their visibility. Their appearance, color, and sizing can be easily customized with our utility classes.
17+
Bootstrap placeholders can enhance your application's user experience. They're built exclusively with HTML and CSS, so you don't need any JavaScript to create them. However, you'll require some custom JavaScript to toggle their visibility. Their appearance, color, and size can be easily customized using our utility classes.
1818

1919
## Example
2020

21-
In the example below, we take a typical card component and recreate it with placeholders applied to create a "loading card". Size and proportions are the same between the two.
22-
21+
In the example below, we use the Bootstrap card component and modify it with placeholders to form a "loading card." The size and proportions remain consistent between the two.
2322
<div class="docs-example docs-example-placeholder-cards d-flex justify-content-around">
2423
<div class="card">
2524
{{< placeholder width="100%" height="180" class="card-img-top" text="false" background="#20c997" >}}
2625
<div class="card-body">
27-
<h5 class="card-title">Card title</h5>
28-
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
26+
<h5 class="card-title">Bootstrap card title</h5>
27+
<p class="card-text">Some brief example text to expand on the card title and form most of the card's content.</p>
2928
<a href="#" class="btn btn-primary">Go somewhere</a>
3029
</div>
3130
</div>
@@ -53,8 +52,8 @@ In the example below, we take a typical card component and recreate it with plac
5352
<img src="..." class="card-img-top" alt="...">
5453

5554
<div class="card-body">
56-
<h5 class="card-title">Card title</h5>
57-
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
55+
<h5 class="card-title">Bootstrap card title</h5>
56+
<p class="card-text">Some brief example text to expand on the card title and form most of the card's content.</p>
5857
<a href="#" class="btn btn-primary">Go somewhere</a>
5958
</div>
6059
</div>
@@ -79,9 +78,10 @@ In the example below, we take a typical card component and recreate it with plac
7978

8079
## How it works
8180

82-
Create placeholders with the `.placeholder` class and a grid column class (e.g., `.col-6`) to set the `width`. They can replace the text inside an element or be added as a modifier class to an existing component.
81+
Create placeholders using the `.placeholder` class along with a grid column class (e.g., `.col-6`) to define the `width`. These placeholders can either replace text inside an element or be added as a modifier class to an existing component.
82+
83+
To ensure the `height` is maintained, we style `.btn`s with `::before`. This pattern can be expanded for other cases or a `&nbsp;` can be added inside the element to match the height when actual text appears.
8384

84-
We apply additional styling to `.btn`s via `::before` to ensure the `height` is respected. You may extend this pattern for other situations as needed, or add a `&nbsp;` within the element to reflect the height when actual text is rendered in its place.
8585

8686
{{< example >}}
8787
<p aria-hidden="true">
@@ -92,12 +92,12 @@ We apply additional styling to `.btn`s via `::before` to ensure the `height` is
9292
{{< /example >}}
9393

9494
{{< callout info >}}
95-
The use of `aria-hidden="true"` only indicates that the element should be hidden to screen readers. The *loading* behavior of the placeholder depends on how authors will actually use the placeholder styles, how they plan to update things, etc. Some JavaScript code may be needed to *swap* the state of the placeholder and inform AT users of the update.
95+
Using `aria-hidden="true"` simply tells screen readers to ignore the element. The actual *loading* behavior of the placeholder depends on how authors implement and style the placeholder, as well as how they update it. Some JavaScript may be necessary to *toggle* the placeholder's state and notify AT users of the change.
9696
{{< /callout >}}
9797

9898
### Width
9999

100-
You can change the `width` through grid column classes, width utilities, or inline styles.
100+
You can adjust the `width` using grid column classes, width utilities, or inline styles.
101101

102102
{{< example >}}
103103
<span class="placeholder col-6"></span>
@@ -107,7 +107,7 @@ You can change the `width` through grid column classes, width utilities, or inli
107107

108108
### Color
109109

110-
By default, the `placeholder` uses `currentColor`. This can be overridden with a custom color or utility class.
110+
By default, the `placeholder` uses `currentColor`, but this can be replaced with a custom color or utility class.
111111

112112
{{< example >}}
113113
<span class="placeholder col-12"></span>
@@ -120,7 +120,7 @@ By default, the `placeholder` uses `currentColor`. This can be overridden with a
120120

121121
### Sizing
122122

123-
The size of `.placeholder`s are based on the typographic style of the parent element. Customize them with sizing modifiers: `.placeholder-lg`, `.placeholder-sm`, or `.placeholder-xs`.
123+
The size of `.placeholder`s depends on the typographic style of the parent element. Customize them with size modifiers: `.placeholder-lg`, `.placeholder-sm`, or `.placeholder-xs`.
124124

125125
{{< example >}}
126126
<span class="placeholder col-12 placeholder-lg"></span>
@@ -131,7 +131,7 @@ The size of `.placeholder`s are based on the typographic style of the parent ele
131131

132132
### Animation
133133

134-
Animate placeholders with `.placeholder-glow` or `.placeholder-wave` to better convey the perception of something being _actively_ loaded.
134+
Animate Bootstrap placeholders using `.placeholder-glow` or `.placeholder-wave` to visually suggest that content is _actively_ loading.
135135

136136
{{< example >}}
137137
<p class="placeholder-glow">

0 commit comments

Comments
 (0)