From: Mark Otto
Date: Wed, 11 Mar 2026 20:18:51 +0000 (-0700)
Subject: Update button selectors and class usage (#42149)
X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=27483ddf53239a9ef4ee56acb4cd89df789425aa;p=thirdparty%2Fbootstrap.git
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
---
diff --git a/config.yml b/config.yml
index ac7ba6e14b..2715816227 100644
--- a/config.yml
+++ b/config.yml
@@ -50,4 +50,4 @@ anchors:
toc:
min: 2
- max: 6
+ max: 3
diff --git a/js/tests/integration/index.html b/js/tests/integration/index.html
index 4c71bad916..3e3035d3c8 100644
--- a/js/tests/integration/index.html
+++ b/js/tests/integration/index.html
@@ -15,7 +15,7 @@
Hello, world!
-
@@ -32,8 +32,8 @@
Oh snap!Change a few things up 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.
- Take this action
- Or do this
+ Take this action
+ Or do this
Navigate to the checkboxes with the keyboard (generally, using Tab / Shift + Tab), and ensure that Space 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 Space toggles the checkbox again.
-
@@ -32,13 +32,13 @@
Navigate to the radio button group with the keyboard (generally, using Tab / Shift + Tab). 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 Tab or "backwards" using Shift + Tab). 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 â and â 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 â and â change the selected radio button again.
-
+
Radio 1 (preselected)
-
+
Radio 2
-
+
Radio 3
diff --git a/js/tests/visual/datepicker.html b/js/tests/visual/datepicker.html
index 472f953f55..e50a9afd58 100644
--- a/js/tests/visual/datepicker.html
+++ b/js/tests/visual/datepicker.html
@@ -90,9 +90,9 @@
Initialized via JavaScript
- Show
- Hide
- Get Dates
+ Show
+ Hide
+ Get Dates
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.
@@ -54,7 +54,7 @@
Press Escape or click the close button to dismiss.
@@ -68,7 +68,7 @@
You must use the close button.
@@ -82,8 +82,8 @@
Notice how the backdrop stays visible during the swap.
@@ -97,8 +97,8 @@
You can swap back to the first dialog or close this one.
@@ -118,50 +118,50 @@
Try clicking the buttons on the page behind this dialog!
-
+
Launch demo dialog
-
+
Launch static backdrop dialog
-
+
Launch no-keyboard dialog
-
+
Launch swap dialog demo
-
+
Launch non-modal dialog
(uses show() instead of showModal())
-
+
Tooltip on auto
-
+
Tooltip on top
-
+
Tooltip on end
-
+
Tooltip on bottom
-
+
Tooltip on start
-
+
Tooltip with container (selector)
-
+
Tooltip with container (element)
-
+
Tooltip with HTML
-
+
Tooltip with XSS
@@ -72,13 +72,13 @@
Test Selector triggered tooltips
- Using title
- Using bs-title
+ Using title
+ Using bs-title
- Duplicate above two buttons
+ Duplicate above two buttons
@@ -90,10 +90,10 @@
if (typeof document.body.attachShadow === 'function') {
const shadowRoot = document.getElementById('shadow').attachShadow({ mode: 'open' })
shadowRoot.innerHTML =
- '' +
+ '' +
' Tooltip on top in a shadow dom' +
'' +
- '' +
+ '' +
' Tooltip on top in a shadow dom' +
''
diff --git a/scss/buttons/_button.scss b/scss/buttons/_button.scss
index 58ffe2e2f3..3826471bb5 100644
--- a/scss/buttons/_button.scss
+++ b/scss/buttons/_button.scss
@@ -165,13 +165,14 @@ $button-variants: defaults(
// Base styles
//
-$btn-variant-selectors: () !default;
+// scss-docs-start btn-variant-selectors
+$btn-variant-selectors: (string.unquote(".btn"), string.unquote(".btn-link"), string.unquote(".btn-icon")) !default;
@each $variant, $config in $button-variants {
$btn-variant-selectors: list.append($btn-variant-selectors, string.unquote(".btn-#{$variant}"), comma);
}
+// scss-docs-end btn-variant-selectors
@layer components {
- .btn,
#{$btn-variant-selectors} {
@include tokens($button-tokens);
diff --git a/site/src/assets/examples/album/index.astro b/site/src/assets/examples/album/index.astro
index 6fe3d5fe68..b4dd5de459 100644
--- a/site/src/assets/examples/album/index.astro
+++ b/site/src/assets/examples/album/index.astro
@@ -45,8 +45,8 @@ import Placeholder from "@shortcodes/Placeholder.astro"
Album example
Something short and leading about the collection belowâits contents, the creator, etc. Make it short and sweet, but not too short so folks donât simply skip over it entirely.
Cover is a one-page template for building simple and beautiful home pages. Download, edit the text, and add your own fullscreen background photo to make it your own.
- Sign up
+ Sign up
By clicking Sign up, you agree to the terms of use.
Or use a third-party
-
+
Sign up with Google
-
+
Sign up with Facebook
-
+
Sign up with GitHub
diff --git a/site/src/assets/examples/features/index.astro b/site/src/assets/examples/features/index.astro
index 5eecc49b45..9b81e02bc5 100644
--- a/site/src/assets/examples/features/index.astro
+++ b/site/src/assets/examples/features/index.astro
@@ -109,7 +109,7 @@ export const extra_css = ['features.css']
Featured title
Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.
Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.
Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.
Left-aligned title explaining these awesome features
Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.
Quickly design and customize responsive mobile-first sites with Bootstrap, the worldâs most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.
Quickly design and customize responsive mobile-first sites with Bootstrap, the worldâs most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.
Quickly design and customize responsive mobile-first sites with Bootstrap, the worldâs most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.
- Primary
- Default
+ Primary
+ Default
@@ -79,7 +79,7 @@ export const extra_css = ['heroes.css']
Remember me
- Sign up
+ Sign up
By clicking Sign up, you agree to the terms of use.
@@ -95,8 +95,8 @@ export const extra_css = ['heroes.css']
Border hero with cropped image and shadows
Quickly design and customize responsive mobile-first sites with Bootstrap, the worldâs most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.
Quickly design and customize responsive mobile-first sites with Bootstrap, the worldâs most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap. Check out the examples below for how you can remix and restyle it to your liking.
- Example button
+ Example button
@@ -24,14 +24,14 @@ export const title = 'Jumbotron example'
Change the background
Swap the background-color utility and add a `.text-*` color utility to mix up the jumbotron look. Then, mix and match with additional component themes and more.
- Example button
+ Example button
Add borders
Or, keep it light and add a border for some added definition to the boundaries of your content. Be sure to look under the hood at the source HTML here as we've adjusted the alignment and sizing of both column's content for equal-height.
- Example button
+ Example button
diff --git a/site/src/assets/examples/jumbotrons/index.astro b/site/src/assets/examples/jumbotrons/index.astro
index 2f7781d49b..9895a27418 100644
--- a/site/src/assets/examples/jumbotrons/index.astro
+++ b/site/src/assets/examples/jumbotrons/index.astro
@@ -25,11 +25,11 @@ export const extra_css = ['jumbotrons.css']
This is a custom jumbotron featuring an SVG image at the top, some longer text that wraps early thanks to a responsive .col-* class, and a customized call to action.
This faded back jumbotron is useful for placeholder content. It's also a great way to add a bit of context to a page or section when no content is available and to encourage visitors to take a specific action.
-
+
Call to action
diff --git a/site/src/assets/examples/navbar-bottom/index.astro b/site/src/assets/examples/navbar-bottom/index.astro
index c3889724f0..a0d41dab7c 100644
--- a/site/src/assets/examples/navbar-bottom/index.astro
+++ b/site/src/assets/examples/navbar-bottom/index.astro
@@ -8,7 +8,7 @@ export const title = 'Bottom navbar example'
Bottom Navbar example
This example is a quick exercise to illustrate how the bottom navbar works.