Skip to content

Commit 27483dd

Browse files
authored
Update button selectors and class usage (#42149)
* Fix a ton of btn classes * Update buttons class list, no need for .btn on any variants now, update classes across docs and examples * fix
1 parent ead00c6 commit 27483dd

74 files changed

Lines changed: 471 additions & 466 deletions

Some content is hidden

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

config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ anchors:
5050

5151
toc:
5252
min: 2
53-
max: 6
53+
max: 3

js/tests/integration/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<h1>Hello, world!</h1>
1616

1717
<div class="mt-5">
18-
<button type="button" class="btn btn-secondary mb-3" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top">
18+
<button type="button" class="btn-outline theme-secondary mb-3" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top">
1919
Tooltip on top
2020
</button>
2121

js/tests/visual/alert.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ <h1>Alert <small>Bootstrap Visual Test</small></h1>
2121
<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again.
2222
</p>
2323
<p>
24-
<button type="button" class="btn btn-danger">Danger</button>
25-
<button type="button" class="btn btn-secondary">Secondary</button>
24+
<button type="button" class="btn-solid theme-danger">Danger</button>
25+
<button type="button" class="btn-solid theme-secondary">Secondary</button>
2626
</p>
2727
</div>
2828

@@ -32,8 +32,8 @@ <h1>Alert <small>Bootstrap Visual Test</small></h1>
3232
<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
3333
</p>
3434
<p>
35-
<button type="button" class="btn btn-danger">Take this action</button>
36-
<button type="button" class="btn btn-primary">Or do this</button>
35+
<button type="button" class="btn-solid theme-danger">Take this action</button>
36+
<button type="button" class="btn-solid theme-primary">Or do this</button>
3737
</p>
3838
</div>
3939

js/tests/visual/button.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@
1010
<div class="container">
1111
<h1>Button <small>Bootstrap Visual Test</small></h1>
1212

13-
<button type="button" class="btn btn-primary" data-bs-toggle="button" aria-pressed="false" autocomplete="off">
13+
<button type="button" class="btn-solid theme-primary" data-bs-toggle="button" aria-pressed="false" autocomplete="off">
1414
Single toggle
1515
</button>
1616

1717
<p>For checkboxes and radio buttons, ensure that keyboard behavior is functioning correctly.</p>
1818
<p>Navigate to the checkboxes with the keyboard (generally, using <kbd>Tab</kbd> / <kbd><kbd>Shift</kbd> + <kbd>Tab</kbd></kbd>), and ensure that <kbd>Space</kbd> toggles the currently focused checkbox. Click on one of the checkboxes using the mouse, ensure that focus was correctly set on the actual checkbox, and that <kbd>Space</kbd> toggles the checkbox again.</p>
1919

2020
<div class="btn-group" data-bs-toggle="buttons">
21-
<label class="btn btn-primary active">
21+
<label class="btn-solid theme-primary active">
2222
<input type="checkbox" checked autocomplete="off"> Checkbox 1 (pre-checked)
2323
</label>
24-
<label class="btn btn-primary">
24+
<label class="btn-solid theme-primary">
2525
<input type="checkbox" autocomplete="off"> Checkbox 2
2626
</label>
27-
<label class="btn btn-primary">
27+
<label class="btn-solid theme-primary">
2828
<input type="checkbox" autocomplete="off"> Checkbox 3
2929
</label>
3030
</div>
3131

3232
<p>Navigate to the radio button group with the keyboard (generally, using <kbd>Tab</kbd> / <kbd><kbd>Shift</kbd> + <kbd>Tab</kbd></kbd>). If no radio button was initially set to be selected, the first/last radio button should receive focus (depending on whether you navigated "forward" to the group with <kbd>Tab</kbd> or "backwards" using <kbd><kbd>Shift</kbd> + <kbd>Tab</kbd></kbd>). If a radio button was already selected, navigating with the keyboard should set focus to that particular radio button. Only one radio button in a group should receive focus at any given time. Ensure that the selected radio button can be changed by using the <kbd></kbd> and <kbd></kbd> arrow keys. Click on one of the radio buttons with the mouse, ensure that focus was correctly set on the actual radio button, and that <kbd></kbd> and <kbd></kbd> change the selected radio button again.</p>
3333

3434
<div class="btn-group" data-bs-toggle="buttons">
35-
<label class="btn btn-primary active">
35+
<label class="btn-solid theme-primary active">
3636
<input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected)
3737
</label>
38-
<label class="btn btn-primary">
38+
<label class="btn-solid theme-primary">
3939
<input type="radio" name="options" id="option2" autocomplete="off"> Radio 2
4040
</label>
41-
<label class="btn btn-primary">
41+
<label class="btn-solid theme-primary">
4242
<input type="radio" name="options" id="option3" autocomplete="off"> Radio 3
4343
</label>
4444
</div>

js/tests/visual/datepicker.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ <h2>JavaScript Initialization</h2>
9090
<label for="jsDatepicker" class="form-label">Initialized via JavaScript</label>
9191
<input type="text" class="form-control" id="jsDatepicker" placeholder="Click to select">
9292
<div class="mt-2">
93-
<button type="button" class="btn btn-primary btn-sm" id="showBtn">Show</button>
94-
<button type="button" class="btn btn-secondary btn-sm" id="hideBtn">Hide</button>
95-
<button type="button" class="btn btn-info btn-sm" id="getDatesBtn">Get Dates</button>
93+
<button type="button" class="btn-solid theme-primary btn-sm" id="showBtn">Show</button>
94+
<button type="button" class="btn-solid theme-secondary btn-sm" id="hideBtn">Hide</button>
95+
<button type="button" class="btn-solid theme-info btn-sm" id="getDatesBtn">Get Dates</button>
9696
</div>
9797
<div id="selectedDatesOutput" class="mt-2 text-body-secondary"></div>
9898
</div>

js/tests/visual/dialog.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h4>Text in a dialog</h4>
2626
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
2727

2828
<h4>Popover in a dialog</h4>
29-
<p>This <button type="button" class="btn btn-primary" data-bs-toggle="popover" data-bs-placement="left" title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">button</button> should trigger a popover on click.</p>
29+
<p>This <button type="button" class="btn-solid theme-primary" data-bs-toggle="popover" data-bs-placement="left" title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">button</button> should trigger a popover on click.</p>
3030

3131
<h4>Tooltips in a dialog</h4>
3232
<p><a href="#" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top">This link</a> and <a href="#" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Tooltip on bottom">that link</a> should have tooltips on hover.</p>
@@ -39,8 +39,8 @@ <h4>Overflowing text to show scroll behavior</h4>
3939
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
4040
</div>
4141
<div class="dialog-footer">
42-
<button type="button" class="btn btn-secondary" data-bs-dismiss="dialog">Close</button>
43-
<button type="button" class="btn btn-primary">Save changes</button>
42+
<button type="button" class="btn-solid theme-secondary" data-bs-dismiss="dialog">Close</button>
43+
<button type="button" class="btn-solid theme-primary">Save changes</button>
4444
</div>
4545
</dialog>
4646

@@ -54,7 +54,7 @@ <h1 class="dialog-title">Static Backdrop Dialog</h1>
5454
<p>Press Escape or click the close button to dismiss.</p>
5555
</div>
5656
<div class="dialog-footer">
57-
<button type="button" class="btn btn-secondary" data-bs-dismiss="dialog">Close</button>
57+
<button type="button" class="btn-solid theme-secondary" data-bs-dismiss="dialog">Close</button>
5858
</div>
5959
</dialog>
6060

@@ -68,7 +68,7 @@ <h1 class="dialog-title">No Keyboard Dismiss</h1>
6868
<p>You must use the close button.</p>
6969
</div>
7070
<div class="dialog-footer">
71-
<button type="button" class="btn btn-secondary" data-bs-dismiss="dialog">Close</button>
71+
<button type="button" class="btn-solid theme-secondary" data-bs-dismiss="dialog">Close</button>
7272
</div>
7373
</dialog>
7474

@@ -82,8 +82,8 @@ <h1 class="dialog-title">First Dialog</h1>
8282
<p>Notice how the backdrop stays visible during the swap.</p>
8383
</div>
8484
<div class="dialog-footer">
85-
<button type="button" class="btn btn-secondary" data-bs-dismiss="dialog">Close</button>
86-
<button type="button" class="btn btn-primary" data-bs-toggle="dialog" data-bs-target="#swapDialog2">Go to Second Dialog</button>
85+
<button type="button" class="btn-solid theme-secondary" data-bs-dismiss="dialog">Close</button>
86+
<button type="button" class="btn-solid theme-primary" data-bs-toggle="dialog" data-bs-target="#swapDialog2">Go to Second Dialog</button>
8787
</div>
8888
</dialog>
8989

@@ -97,8 +97,8 @@ <h1 class="dialog-title">Second Dialog</h1>
9797
<p>You can swap back to the first dialog or close this one.</p>
9898
</div>
9999
<div class="dialog-footer">
100-
<button type="button" class="btn btn-secondary" data-bs-dismiss="dialog">Close</button>
101-
<button type="button" class="btn btn-primary" data-bs-toggle="dialog" data-bs-target="#swapDialog1">Back to First Dialog</button>
100+
<button type="button" class="btn-solid theme-secondary" data-bs-dismiss="dialog">Close</button>
101+
<button type="button" class="btn-solid theme-primary" data-bs-toggle="dialog" data-bs-target="#swapDialog1">Back to First Dialog</button>
102102
</div>
103103
</dialog>
104104

@@ -118,50 +118,50 @@ <h1 class="dialog-title">Non-Modal Dialog</h1>
118118
<p>Try clicking the buttons on the page behind this dialog!</p>
119119
</div>
120120
<div class="dialog-footer">
121-
<button type="button" class="btn btn-secondary" data-bs-dismiss="dialog">Close</button>
121+
<button type="button" class="btn-solid theme-secondary" data-bs-dismiss="dialog">Close</button>
122122
</div>
123123
</dialog>
124124

125125
<div class="d-flex flex-column gap-3">
126126
<div>
127-
<button type="button" class="btn btn-primary btn-lg" data-bs-toggle="dialog" data-bs-target="#myDialog">
127+
<button type="button" class="btn-solid theme-primary btn-lg" data-bs-toggle="dialog" data-bs-target="#myDialog">
128128
Launch demo dialog
129129
</button>
130130
</div>
131131

132132
<div>
133-
<button type="button" class="btn btn-secondary btn-lg" data-bs-toggle="dialog" data-bs-target="#staticBackdropDialog" data-bs-backdrop="static">
133+
<button type="button" class="btn-solid theme-secondary btn-lg" data-bs-toggle="dialog" data-bs-target="#staticBackdropDialog" data-bs-backdrop="static">
134134
Launch static backdrop dialog
135135
</button>
136136
</div>
137137

138138
<div>
139-
<button type="button" class="btn btn-secondary btn-lg" data-bs-toggle="dialog" data-bs-target="#noKeyboardDialog" data-bs-keyboard="false">
139+
<button type="button" class="btn-solid theme-secondary btn-lg" data-bs-toggle="dialog" data-bs-target="#noKeyboardDialog" data-bs-keyboard="false">
140140
Launch no-keyboard dialog
141141
</button>
142142
</div>
143143

144144
<div>
145-
<button type="button" class="btn btn-secondary btn-lg" data-bs-toggle="dialog" data-bs-target="#swapDialog1">
145+
<button type="button" class="btn-solid theme-secondary btn-lg" data-bs-toggle="dialog" data-bs-target="#swapDialog1">
146146
Launch swap dialog demo
147147
</button>
148148
</div>
149149

150150
<div>
151-
<button type="button" class="btn btn-info btn-lg" data-bs-toggle="dialog" data-bs-target="#nonModalDialog" data-bs-modal="false">
151+
<button type="button" class="btn-solid theme-info btn-lg" data-bs-toggle="dialog" data-bs-target="#nonModalDialog" data-bs-modal="false">
152152
Launch non-modal dialog
153153
</button>
154154
<small class="text-muted">(uses <code>show()</code> instead of <code>showModal()</code>)</small>
155155
</div>
156156

157157
<div>
158-
<button type="button" class="btn btn-secondary btn-lg" id="tall-toggle">
158+
<button type="button" class="btn-solid theme-secondary btn-lg" id="tall-toggle">
159159
Toggle tall &lt;body&gt; content
160160
</button>
161161
</div>
162162

163163
<div>
164-
<button type="button" class="btn btn-secondary btn-lg" id="jsOpen">
164+
<button type="button" class="btn-solid theme-secondary btn-lg" id="jsOpen">
165165
Open via JavaScript
166166
</button>
167167
</div>

js/tests/visual/dropdown-submenu.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h2>Basic Submenu</h2>
6363

6464
<div class="demo-box">
6565
<div class="dropdown">
66-
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
66+
<button class="btn-solid theme-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
6767
Dropdown with Submenu
6868
</button>
6969
<ul class="dropdown-menu">
@@ -93,7 +93,7 @@ <h2>Nested Submenus (Multi-level)</h2>
9393

9494
<div class="demo-box">
9595
<div class="dropdown">
96-
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
96+
<button class="btn-solid theme-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
9797
Multi-level Menu
9898
</button>
9999
<ul class="dropdown-menu">
@@ -130,7 +130,7 @@ <h2>Multiple Submenus at Same Level</h2>
130130

131131
<div class="demo-box">
132132
<div class="dropdown">
133-
<button class="btn btn-info dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
133+
<button class="btn-solid theme-info dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
134134
Multiple Submenus
135135
</button>
136136
<ul class="dropdown-menu">
@@ -179,7 +179,7 @@ <h2>Viewport Detection (Flipping)</h2>
179179

180180
<div class="demo-box" style="justify-content: space-between;">
181181
<div class="dropdown">
182-
<button class="btn btn-success dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
182+
<button class="btn-solid theme-success dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
183183
Left Side (opens right)
184184
</button>
185185
<ul class="dropdown-menu">
@@ -197,7 +197,7 @@ <h2>Viewport Detection (Flipping)</h2>
197197
</div>
198198

199199
<div class="dropdown">
200-
<button class="btn btn-success dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
200+
<button class="btn-solid theme-success dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
201201
Right Side (flips left)
202202
</button>
203203
<ul class="dropdown-menu">
@@ -278,7 +278,7 @@ <h2>Dropup with Submenus</h2>
278278

279279
<div class="demo-box demo-box-center" style="min-height: 200px;">
280280
<div class="btn-group dropup">
281-
<button type="button" class="btn btn-warning dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
281+
<button type="button" class="btn-solid theme-warning dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
282282
Dropup Menu
283283
</button>
284284
<ul class="dropdown-menu">
@@ -305,7 +305,7 @@ <h2>With Icons</h2>
305305

306306
<div class="demo-box">
307307
<div class="dropdown">
308-
<button class="btn btn-dark dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
308+
<button class="btn-solid theme-dark dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
309309
Menu with Icons
310310
</button>
311311
<ul class="dropdown-menu">
@@ -356,7 +356,7 @@ <h2>Mobile Mode</h2>
356356

357357
<div class="demo-box">
358358
<div class="dropdown">
359-
<button class="btn btn-danger dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
359+
<button class="btn-solid theme-danger dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
360360
Test on Mobile
361361
</button>
362362
<ul class="dropdown-menu">
@@ -392,7 +392,7 @@ <h2>With Disabled Items</h2>
392392

393393
<div class="demo-box">
394394
<div class="dropdown">
395-
<button class="btn btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
395+
<button class="btn-solid theme-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
396396
Menu with Disabled
397397
</button>
398398
<ul class="dropdown-menu">

0 commit comments

Comments
 (0)