Skip to content

Commit 9013c98

Browse files
Docs: add explanation of the base .btn class (#37275)
* Docs: add explanation of the base `.btn` class and a callout reminding authors to at least define some focus styling if they intend to use it "naked" * Turn callout into a warning * Add initial heading * Tweak callout wording
1 parent 3ee2a75 commit 9013c98

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

site/content/docs/5.3/components/buttons.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,21 @@ group: components
66
toc: true
77
---
88

9-
## Examples
9+
## Base class
10+
11+
Bootstrap has a base `.btn` class that sets up basic styles such as padding and content alignment. By default, `.btn` controls have a transparent border and background color, and lack any explicit focus and hover styles.
12+
13+
{{< example >}}
14+
<button type="button" class="btn">Base class</button>
15+
{{< /example >}}
16+
17+
The `.btn` class is intended to be used in conjunction with our additional predefined button styles, or to serve as a basis for your own custom styles.
18+
19+
{{< callout warning >}}
20+
If you are using the `.btn` class on its own, remember to at least define some explicit `:focus` and/or `:focus-visible` styles.
21+
{{< /callout >}}
22+
23+
## Predefined styles
1024

1125
Bootstrap includes several predefined button styles, each serving its own semantic purpose, with a few extras thrown in for more control.
1226

0 commit comments

Comments
 (0)