]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Move SVGs to CSS masks (#42465)
authorMark Otto <markd.otto@gmail.com>
Fri, 5 Jun 2026 03:09:03 +0000 (20:09 -0700)
committerGitHub <noreply@github.com>
Fri, 5 Jun 2026 03:09:03 +0000 (20:09 -0700)
* Move SVGs to CSS masks

* update migration, remove unused, fix a couple things

* Format

* Bump bundlewatch

* Properly size btn-close with mask

* Apply .check class directly to checkbox input, drop wrapper

The .check wrapper existed only to host the checkmark pseudo-element.
Since appearance: none controls render pseudo-elements (as .radio already
relies on), move .check onto the <input> itself and draw the checked/
indeterminate mark via a masked ::before. Removes the grid/:has machinery
and makes checkbox and radio markup symmetric.

* Use .form-field for list group radio example, matching checkboxes

46 files changed:
.bundlewatch.config.json
scss/_breadcrumb.scss
scss/_carousel.scss
scss/_datepicker.scss
scss/_drawer.scss
scss/_navbar.scss
scss/buttons/_close.scss
scss/forms/_check.scss
scss/forms/_validation.scss
scss/mixins/_mask-icon.scss [new file with mode: 0644]
scss/mixins/index.scss
site/src/assets/examples/album/index.astro
site/src/assets/examples/carousel/index.astro
site/src/assets/examples/cheatsheet/index.astro
site/src/assets/examples/checkout/index.astro
site/src/assets/examples/drawer-navbar/index.astro
site/src/assets/examples/heroes/index.astro
site/src/assets/examples/list-groups/index.astro
site/src/assets/examples/list-groups/list-groups.css
site/src/assets/examples/navbar-bottom/index.astro
site/src/assets/examples/navbar-fixed/index.astro
site/src/assets/examples/navbar-static/index.astro
site/src/assets/examples/navbars-drawer/index.astro
site/src/assets/examples/navbars/index.astro
site/src/assets/examples/product/index.astro
site/src/assets/examples/sign-in/index.astro
site/src/assets/examples/sticky-footer-navbar/index.astro
site/src/components/header/Navigation.astro
site/src/components/icons/HamburgerIcon.astro [deleted file]
site/src/components/shortcodes/CloseButton.astro
site/src/content/docs/components/breadcrumb.mdx
site/src/content/docs/components/close-button.mdx
site/src/content/docs/components/list-group.mdx
site/src/content/docs/components/menu.mdx
site/src/content/docs/components/navbar.mdx
site/src/content/docs/customize/sass.mdx
site/src/content/docs/customize/theme.mdx
site/src/content/docs/forms/checkbox.mdx
site/src/content/docs/forms/field.mdx
site/src/content/docs/forms/input-group.mdx
site/src/content/docs/forms/layout.mdx
site/src/content/docs/forms/overview.mdx
site/src/content/docs/forms/validation.mdx
site/src/content/docs/guides/migration.mdx
site/src/libs/placeholder.ts
site/src/scss/_syntax.scss

index b6ec56b0e3bda2761cdde18a5ea4ea4a6ac751f0..25c981393a043c310e766063e8be0fb4d728fdf6 100644 (file)
     },
     {
       "path": "./dist/css/bootstrap.css",
-      "maxSize": "48.75 kB"
+      "maxSize": "49.25 kB"
     },
     {
       "path": "./dist/css/bootstrap.min.css",
-      "maxSize": "45.25 kB"
+      "maxSize": "46.0 kB"
     },
     {
       "path": "./dist/js/bootstrap.bundle.js",
index 499d352310abed2624f08f351e8593677b0721e6..03f4240cf4484579810da34e4009d4da1f0be1c2 100644 (file)
@@ -1,5 +1,6 @@
 @use "functions" as *;
 @use "mixins/border-radius" as *;
+@use "mixins/mask-icon" as *;
 @use "mixins/transition" as *;
 @use "mixins/tokens" as *;
 
@@ -14,6 +15,9 @@ $breadcrumb-tokens: defaults(
     --breadcrumb-bg: transparent,
     --breadcrumb-border-radius: var(--radius-5),
     --breadcrumb-divider-color: var(--fg-4),
+    --breadcrumb-divider-icon: #{escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 16'><path fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M2 2l4 6-4 6'/></svg>"))},
+    --breadcrumb-divider-width: .375rem,
+    --breadcrumb-divider-height: .75rem,
     --breadcrumb-link-padding-x: .75rem,
     --breadcrumb-link-padding-y: .25rem,
     --breadcrumb-link-color: var(--fg-3),
@@ -47,6 +51,18 @@ $breadcrumb-tokens: defaults(
   .breadcrumb-divider {
     margin-inline: calc(var(--breadcrumb-link-padding-x) / 4);
     color: var(--breadcrumb-divider-color);
+
+    // Render a default chevron, painted with `currentcolor` via a mask, when the
+    // divider has no explicit content. Any content (an inline SVG, a text
+    // character, etc.) added to the element overrides this default.
+    &:empty::before {
+      display: block;
+      width: var(--breadcrumb-divider-width);
+      height: var(--breadcrumb-divider-height);
+      content: "";
+      background-color: currentcolor;
+      @include mask-icon(var(--breadcrumb-divider-icon));
+    }
   }
 
   .breadcrumb-link {
index 10bfdbad0cfcfe2414dfcc75ed1f14e0a76356fb..550df2fc31a42911fee763ce0771bc21411734d4 100644 (file)
@@ -3,6 +3,7 @@
 @use "functions" as *;
 @use "mixins/transition" as *;
 @use "mixins/color-mode" as *;
+@use "mixins/mask-icon" as *;
 @use "mixins/tokens" as *;
 
 $carousel-tokens: () !default;
@@ -30,8 +31,8 @@ $carousel-tokens: defaults(
     --carousel-caption-padding-y: 1.25rem,
     --carousel-caption-spacer: 1.25rem,
     --carousel-control-icon-width: 2rem,
-    --carousel-control-prev-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0'/></svg>"),
-    --carousel-control-next-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708'/></svg>"),
+    --carousel-control-prev-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0'/></svg>"),
+    --carousel-control-next-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708'/></svg>"),
     --carousel-transition-duration: .6s,
     --carousel-transition: transform .6s ease-in-out,
   ),
@@ -178,31 +179,30 @@ $carousel-dark-tokens: defaults(
     background-image: if(sass($enable-gradients): linear-gradient(270deg, rgb(0 0 0 / .25), rgb(0 0 0 / .001)); else: null);
   }
 
-  // Icons for within
+  // Icons for within, rendered via CSS mask so they inherit a configurable color
   .carousel-control-prev-icon,
   .carousel-control-next-icon {
     display: inline-block;
     width: var(--carousel-control-icon-width);
     height: var(--carousel-control-icon-width);
-    background-repeat: no-repeat;
-    background-position: 50%;
-    background-size: 100% 100%;
+    background-color: var(--carousel-control-color);
+    @include mask-icon($size: 100% 100%, $position: 50%);
   }
 
   .carousel-control-prev-icon {
-    background-image: var(--carousel-control-prev-icon-bg);
+    mask-image: var(--carousel-control-prev-icon);
   }
 
   [dir="rtl"] .carousel-control-prev-icon {
-    background-image: var(--carousel-control-next-icon-bg);
+    mask-image: var(--carousel-control-next-icon);
   }
 
   .carousel-control-next-icon {
-    background-image: var(--carousel-control-next-icon-bg);
+    mask-image: var(--carousel-control-next-icon);
   }
 
   [dir="rtl"] .carousel-control-next-icon {
-    background-image: var(--carousel-control-prev-icon-bg);
+    mask-image: var(--carousel-control-prev-icon);
   }
 
   // Optional indicator pips/controls
index ae8c9adec6644c3f86644d1e99a0c287ac23ca17..d45f1e39a5e9cd2500a93bf89a9a64077bdd086c 100644 (file)
@@ -4,6 +4,7 @@
 @use "config" as *;
 @use "mixins/border-radius" as *;
 @use "mixins/focus-ring" as *;
+@use "mixins/mask-icon" as *;
 @use "mixins/tokens" as *;
 
 $datepicker-tokens: () !default;
@@ -113,9 +114,8 @@ $datepicker-tokens: defaults(
       position: absolute;
       inset: .25rem;
       content: "";
-      background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%236b7280' d='M12 16c-.3 0-.5-.1-.7-.3l-6-6c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l5.3 5.3 5.3-5.3c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-6 6c-.2.2-.4.3-.7.3'/></svg>");
-      background-repeat: no-repeat;
-      background-position: center;
+      background-color: var(--datepicker-color);
+      @include mask-icon(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 16c-.3 0-.5-.1-.7-.3l-6-6c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l5.3 5.3 5.3-5.3c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-6 6c-.2.2-.4.3-.7.3'/></svg>"), $size: null);
     }
 
     &:hover {
index 7c9edeac837e27838482da32148782358675e2c6..b14f175694162e89854b91ae82d447ed33455b9a 100644 (file)
@@ -266,11 +266,8 @@ $drawer-backdrop-tokens: defaults(
     @include dialog-header(var(--drawer-padding-y) var(--drawer-padding-x));
 
     .btn-close {
-      padding: calc(var(--drawer-padding-y) * .5) calc(var(--drawer-padding-x) * .5);
+      margin-block: calc(-.5 * var(--drawer-padding-y));
       margin-inline-start: auto;
-      margin-inline-end: calc(-.5 * var(--drawer-padding-x));
-      margin-top: calc(-.5 * var(--drawer-padding-y));
-      margin-bottom: calc(-.5 * var(--drawer-padding-y));
     }
   }
 
index 7c30a57a20e85c14be0462dea721fd984f1bb43d..441a08aa5a3c84cb0e21c5f4bb451b7a45dd4e9d 100644 (file)
@@ -2,6 +2,7 @@
 @use "functions" as *;
 @use "layout/breakpoints" as *;
 @use "mixins/box-shadow" as *;
+@use "mixins/mask-icon" as *;
 @use "mixins/tokens" as *;
 @use "mixins/transition" as *;
 
@@ -40,6 +41,8 @@ $navbar-tokens: defaults(
     --navbar-toggler-border-color: color-mix(in oklch, var(--fg-body) 15%, transparent),
     --navbar-toggler-border-radius: var(--radius-5),
     --navbar-toggler-transition: box-shadow .15s ease-in-out,
+    --navbar-toggler-icon-size: 1.25rem,
+    --navbar-toggler-icon: #{escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path stroke='black' stroke-linecap='round' stroke-width='1' d='M1 3.5h14M1 8h14M1 12.5h14'/></svg>"))},
   ),
   $navbar-tokens
 );
@@ -182,6 +185,15 @@ $navbar-nav-tokens: defaults(
     --btn-hover-bg: var(--bg-2);
   }
 
+  // Hamburger icon, rendered via CSS mask so it inherits the navbar color
+  .navbar-toggler-icon {
+    display: inline-block;
+    width: var(--navbar-toggler-icon-size);
+    height: var(--navbar-toggler-icon-size);
+    background-color: currentcolor;
+    @include mask-icon(var(--navbar-toggler-icon));
+  }
+
   // scss-docs-start navbar-expand-loop
   // Generate series of responsive `.navbar-expand` classes for configuring
   // where your navbar collapses and expands. Uses container queries so the
index 98c653eba0a69647231efc25752b2e1c9fe73471..02a392326ac2c0f9c67e6d52f945d5e330bad1b2 100644 (file)
@@ -1,6 +1,7 @@
 @use "../functions" as *;
 @use "../mixins/border-radius" as *;
 @use "../mixins/focus-ring" as *;
+@use "../mixins/mask-icon" as *;
 @use "../mixins/tokens" as *;
 
 $btn-close-tokens: () !default;
@@ -9,8 +10,9 @@ $btn-close-tokens: () !default;
 // stylelint-disable-next-line scss/dollar-variable-default
 $btn-close-tokens: defaults(
   (
-    --btn-close-size: 1.25rem,
+    --btn-close-size: 1.5rem,
     --btn-close-color: inherit,
+    --btn-close-icon: #{escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M12 0a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4zm-.646 4.646a.5.5 0 0 0-.707 0L8 7.293 5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.647a.5.5 0 1 0 .708.707L8 8.707l2.647 2.646a.5.5 0 1 0 .707-.707L8.707 8l2.646-2.646a.5.5 0 0 0 0-.708z'/></svg>"))},
     --btn-close-opacity: .5,
     --btn-close-hover-opacity: .75,
     --btn-close-focus-opacity: .85,
@@ -33,17 +35,11 @@ $btn-close-tokens: defaults(
     height: var(--btn-close-size);
     padding: 0;
     color: var(--btn-close-color);
-    background: transparent; // for button elements
+    background-color: currentcolor;
     border: 0; // for button elements
     @include border-radius(var(--radius-5));
     opacity: var(--btn-close-opacity);
-
-    > svg {
-      display: block;
-      width: 100%;
-      height: 100%;
-      fill: currentcolor;
-    }
+    @include mask-icon(var(--btn-close-icon));
 
     // Override <a>'s hover style
     &:hover {
index 2e83bbc2554b46cdb5d7d9883e8ad40ed2993308..6264402c59b3e09cf267f474660538c86dbf6fec 100644 (file)
@@ -1,5 +1,6 @@
 @use "../functions" as *;
 @use "../mixins/focus-ring" as *;
+@use "../mixins/mask-icon" as *;
 @use "../mixins/tokens" as *;
 
 // stylelint-disable custom-property-no-missing-var-function
@@ -14,6 +15,8 @@ $check-tokens: defaults(
     --check-bg: var(--bg-body),
     --check-border-color: var(--border-color),
     --check-border-radius: .375rem,
+    --check-icon-checked: #{escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/></svg>"))},
+    --check-icon-indeterminate: #{escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 10h8'/></svg>"))},
     --check-checked-bg: var(--control-checked-bg),
     --check-checked-border-color: var(--control-checked-border-color),
     --check-indeterminate-bg: var(--control-checked-bg),
@@ -29,48 +32,49 @@ $check-tokens: defaults(
 // stylelint-enable custom-property-no-missing-var-function
 
 @layer forms {
+  // The class lives on the `<input>` itself; `appearance: none` controls render
+  // pseudo-elements, so the mark is drawn directly on the input — no wrapper.
   .check {
     @include tokens($check-tokens);
 
-    display: grid;
-    grid-template-columns: repeat(1, minmax(0, 1fr));
+    position: relative;
+    flex-shrink: 0;
+    width: var(--check-size);
+    height: var(--check-size);
     margin-block: var(--check-margin-block);
+    appearance: none;
+    // later: maybe set a tertiary bg color?
+    background-color: var(--theme-bg, var(--check-bg));
+    border: 1px solid var(--theme-bg, var(--check-border-color));
+    // stylelint-disable-next-line property-disallowed-list
+    border-radius: .3em;
 
-    :where(svg, input) {
-      flex-shrink: 0;
-      grid-row-start: 1;
-      grid-column-start: 1;
-      width: var(--check-size);
-      height: var(--check-size);
-    }
-
-    :where(input) {
-      appearance: none;
-      // later: maybe set a tertiary bg color?
-      background-color: var(--theme-bg, var(--check-bg));
-      border: 1px solid var(--theme-bg, var(--check-border-color));
-      // stylelint-disable-next-line property-disallowed-list
-      border-radius: .3em;
-    }
-
-    :where(input:checked, input:indeterminate) {
+    &:checked,
+    &:indeterminate {
       background-color: var(--theme-bg, var(--check-checked-bg));
       border-color: var(--theme-bg, var(--check-checked-border-color));
+
+      // Check/indeterminate mark, overlaid on the input and rendered via a CSS
+      // mask so it inherits the contrast color without an inline SVG.
+      &::before {
+        position: absolute;
+        inset: 0;
+        pointer-events: none;
+        content: "";
+        background-color: var(--theme-contrast, var(--primary-contrast));
+        @include mask-icon();
+      }
     }
 
-    :where(input:focus-visible) {
+    &:checked::before { mask-image: var(--check-icon-checked); }
+    &:indeterminate::before { mask-image: var(--check-icon-indeterminate); }
+
+    &:focus-visible {
       @include focus-ring(true);
       --focus-ring-offset: -1px;
     }
 
-    &:has(input:checked) .checked,
-    &:has(input:indeterminate) .indeterminate {
-      display: block;
-      color: var(--theme-contrast, var(--primary-contrast));
-      stroke: currentcolor;
-    }
-
-    &:has(input:disabled) {
+    &:disabled {
       --check-bg: var(--check-disabled-bg);
 
       ~ label {
@@ -78,17 +82,9 @@ $check-tokens: defaults(
         cursor: default;
       }
     }
-    &:has(input:disabled:checked) {
+    &:disabled:checked {
       opacity: var(--check-disabled-opacity);
     }
-
-    :where(svg) {
-      pointer-events: none;
-    }
-
-    :where(svg path) {
-      display: none;
-    }
   }
 
   .check-sm {
index adc50d20450b2d4839e1f8e79ea550257b70a49c..58660f3cc8635af812415d3a9dbd331dc968e2b9 100644 (file)
@@ -70,7 +70,7 @@ $validation-states: defaults(
   }
 
   // Checkbox — control-level styling (border, checked bg, focus ring).
-  .check input {
+  .check {
     @include form-validation-state-selector($state) {
       --check-border-color: var(--#{$theme}-border);
       --check-checked-bg: var(--#{$theme}-bg);
@@ -83,7 +83,7 @@ $validation-states: defaults(
   }
 
   // Checkbox — label color and feedback display via .form-field:has().
-  .form-field:has(.check input.is-#{$state}) {
+  .form-field:has(.check.is-#{$state}) {
     label { color: var(--#{$theme}-fg); }
 
     .#{$state}-feedback,
@@ -91,14 +91,14 @@ $validation-states: defaults(
   }
 
   @if $state == "invalid" {
-    [data-bs-validate] .form-field:has(.check input:user-invalid) {
+    [data-bs-validate] .form-field:has(.check:user-invalid) {
       label { color: var(--#{$theme}-fg); }
 
       .invalid-feedback,
       .invalid-tooltip { display: block; }
     }
   } @else if $state == "valid" {
-    [data-bs-validate~="valid"] .form-field:has(.check input:user-valid) {
+    [data-bs-validate~="valid"] .form-field:has(.check:user-valid) {
       label { color: var(--#{$theme}-fg); }
 
       .valid-feedback,
diff --git a/scss/mixins/_mask-icon.scss b/scss/mixins/_mask-icon.scss
new file mode 100644 (file)
index 0000000..f4d1fd7
--- /dev/null
@@ -0,0 +1,21 @@
+// Mask icon
+//
+// Renders an SVG icon via a CSS mask so the shape is painted with the
+// element's `background-color` and therefore inherits theme/dark-mode color.
+// Set `background-color` on the element itself; pass `null` for `$icon` when
+// the mask image is applied conditionally (e.g. per state or direction).
+
+// scss-docs-start mask-icon-mixin
+@mixin mask-icon($icon: null, $size: contain, $position: center) {
+  @if $icon != null {
+    mask-image: $icon;
+  }
+  mask-repeat: no-repeat;
+  @if $position != null {
+    mask-position: $position;
+  }
+  @if $size != null {
+    mask-size: $size;
+  }
+}
+// scss-docs-end mask-icon-mixin
index 881ee9176e9dcf827010876f8b08080f2016fbca..a0201ed347b293bc66a9cd96ec33b5ea10fa08ca 100644 (file)
@@ -23,6 +23,7 @@
 @forward "backdrop";
 @forward "caret";
 @forward "form-validation";
+@forward "mask-icon";
 
 // Skins
 @forward "border-radius";
index a670e5658eedede504a8cde7891be0df00f41c6a..96867b75151e20e11e9df038bec1374451a28030 100644 (file)
@@ -31,7 +31,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
         <strong>Album</strong>
       </a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
     </div>
   </nav>
index c21400bd0a51f352ee98573d40129c5686dc951c..a98848b2896749576f71951679dd8fbcd9b5b03e 100644 (file)
@@ -9,7 +9,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Carousel</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <div class="collapse navbar-collapse" id="navbarCollapse">
         <ul class="navbar-nav me-auto mb-2 md:mb-0">
index db1300402b4bdd76bde6245ddec130a2ed7de57e..a4d0b6ee117d0cef44df27a7afdae04e8a99bbc1 100644 (file)
@@ -333,13 +333,7 @@ export const body_class = 'bg-body-tertiary'
             </select>
           </div>
           <div class="mb-3 form-field">
-            <div class="check">
-              <input type="checkbox" id="exampleCheck1">
-              <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-                <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-                <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-              </svg>
-            </div>
+            <input type="checkbox" id="exampleCheck1" class="check">
             <label for="exampleCheck1">Check me out</label>
           </div>
           <fieldset class="mb-3">
@@ -392,13 +386,7 @@ export const body_class = 'bg-body-tertiary'
               </select>
             </div>
             <div class="mb-3 form-field">
-              <div class="check">
-                <input type="checkbox" id="disabledFieldsetCheck" disabled>
-                <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-                  <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-                  <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-                </svg>
-              </div>
+              <input type="checkbox" id="disabledFieldsetCheck" class="check" disabled>
               <label for="disabledFieldsetCheck">
                 Can't check this
               </label>
@@ -587,13 +575,7 @@ export const body_class = 'bg-body-tertiary'
           </div>
           <div class="col-12">
             <div class="form-field">
-              <div class="check">
-                <input class="is-invalid" type="checkbox" value="" id="invalidCheck3" required>
-                <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-                  <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-                  <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-                </svg>
-              </div>
+              <input class="check is-invalid" type="checkbox" value="" id="invalidCheck3" required>
               <label for="invalidCheck3">
                 Agree to terms and conditions
               </label>
@@ -1210,7 +1192,7 @@ export const body_class = 'bg-body-tertiary'
                 <img src="${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')}" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy" style="filter: invert(1) grayscale(100%) brightness(200%);">
               </a>
               <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
-                <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+                <span class="navbar-toggler-icon" aria-hidden="true"></span>
               </button>
               <div class="collapse navbar-collapse" id="navbarSupportedContent">
                 <ul class="navbar-nav me-auto mb-2 lg:mb-0">
@@ -1249,7 +1231,7 @@ export const body_class = 'bg-body-tertiary'
                 <img src="${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')}" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy">
               </a>
               <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent2" aria-controls="navbarSupportedContent2" aria-expanded="false" aria-label="Toggle navigation">
-                <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+                <span class="navbar-toggler-icon" aria-hidden="true"></span>
               </button>
               <div class="collapse navbar-collapse" id="navbarSupportedContent2">
                 <ul class="navbar-nav me-auto mb-2 lg:mb-0">
index 802199d2986ec2e1430ff3b1e95d1d502a953c20..5f5284b85b369bf37963d9cd381ea2635092d05f 100644 (file)
@@ -149,24 +149,12 @@ export const body_class = 'bg-body-tertiary'
           <hr class="my-4">
 
           <div class="form-field">
-            <div class="check">
-              <input type="checkbox" id="same-address">
-              <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-                <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-                <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-              </svg>
-            </div>
+            <input type="checkbox" id="same-address" class="check">
             <label for="same-address">Shipping address is the same as my billing address</label>
           </div>
 
           <div class="form-field">
-            <div class="check">
-              <input type="checkbox" id="save-info">
-              <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-                <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-                <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-              </svg>
-            </div>
+            <input type="checkbox" id="save-info" class="check">
             <label for="save-info">Save this information for next time</label>
           </div>
 
index 0ace3088b29c878cfe7dc9393b3d2f087abbd6d3..ac803da2be3e233f42378afdda27578564323614 100644 (file)
@@ -13,7 +13,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
   <div class="container-fluid">
     <a class="navbar-brand" href="#">Drawer navbar</a>
     <button class="navbar-toggler p-0 border-0" type="button" id="navbarSideCollapse" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
 
     <div class="navbar-collapse drawer-collapse" id="navbarsExampleDefault">
index b2ec32f86894b1726af507a791fc72bf3c6ec604..a49b2df6ecc765a6fb23f730a2c1afd8e48d07da 100644 (file)
@@ -75,13 +75,7 @@ export const extra_css = ['heroes.css']
             <label for="floatingPassword">Password</label>
           </div>
           <div class="form-field mb-3">
-            <div class="check">
-              <input type="checkbox" value="remember-me" id="heroRememberMe">
-              <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-                <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-                <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-              </svg>
-            </div>
+            <input type="checkbox" value="remember-me" id="heroRememberMe" class="check">
             <label for="heroRememberMe">Remember me</label>
           </div>
           <button class="w-100 btn-solid theme-primary btn-lg" type="submit">Sign up</button>
index af2067ba95aa80960007497301f5e913948d9b5e..07da876ab3b78d6e562a472ab294f177469f09df 100644 (file)
@@ -59,39 +59,21 @@ export const extra_css = ['list-groups.css']
 <div class="d-flex flex-column md:flex-row p-4 gap-4 md:py-5 align-items-center justify-content-center">
   <div class="list-group">
     <label class="list-group-item d-flex gap-2">
-      <div class="check flex-shrink-0">
-        <input type="checkbox" value="" checked>
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" value="" class="check flex-shrink-0" checked>
       <span>
         First checkbox
         <small class="d-block fg-2">With support text underneath to add more detail</small>
       </span>
     </label>
     <label class="list-group-item d-flex gap-2">
-      <div class="check flex-shrink-0">
-        <input type="checkbox" value="">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" value="" class="check flex-shrink-0">
       <span>
         Second checkbox
         <small class="d-block fg-2">Some other text goes here</small>
       </span>
     </label>
     <label class="list-group-item d-flex gap-2">
-      <div class="check flex-shrink-0">
-        <input type="checkbox" value="">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" value="" class="check flex-shrink-0">
       <span>
         Third checkbox
         <small class="d-block fg-2">And we end with another snippet of text</small>
@@ -129,13 +111,7 @@ export const extra_css = ['list-groups.css']
 <div class="d-flex flex-column md:flex-row p-4 gap-4 md:py-5 align-items-center justify-content-center">
   <div class="list-group">
     <label class="list-group-item d-flex gap-3">
-      <div class="check flex-shrink-0" style="font-size: 1.375em;">
-        <input type="checkbox" value="" checked>
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" value="" class="check flex-shrink-0" style="font-size: 1.375em;" checked>
       <span class="pt-1 form-checked-content">
         <strong>Finish sales report</strong>
         <small class="d-block fg-2">
@@ -145,13 +121,7 @@ export const extra_css = ['list-groups.css']
       </span>
     </label>
     <label class="list-group-item d-flex gap-3">
-      <div class="check flex-shrink-0" style="font-size: 1.375em;">
-        <input type="checkbox" value="">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" value="" class="check flex-shrink-0" style="font-size: 1.375em;">
       <span class="pt-1 form-checked-content">
         <strong>Weekly All Hands</strong>
         <small class="d-block fg-2">
@@ -161,13 +131,7 @@ export const extra_css = ['list-groups.css']
       </span>
     </label>
     <label class="list-group-item d-flex gap-3">
-      <div class="check flex-shrink-0" style="font-size: 1.375em;">
-        <input type="checkbox" value="">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" value="" class="check flex-shrink-0" style="font-size: 1.375em;">
       <span class="pt-1 form-checked-content">
         <strong>Out of office</strong>
         <small class="d-block fg-2">
@@ -177,13 +141,7 @@ export const extra_css = ['list-groups.css']
       </span>
     </label>
     <label class="list-group-item d-flex gap-3 bg-body-tertiary">
-      <div class="check check-input-placeholder bg-body-tertiary flex-shrink-0 pe-none" style="font-size: 1.375em;">
-        <input disabled type="checkbox" value="">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input disabled type="checkbox" value="" class="check check-input-placeholder bg-body-tertiary flex-shrink-0 pe-none" style="font-size: 1.375em;">
       <span class="pt-1 form-checked-content">
         <span contenteditable="true" class="w-100">Add new task...</span>
         <small class="d-block fg-2">
index fdb7e662092da0c090e10353ee4b66e415454aa7..706ca04481efe3a4c99d34956671c2655be7ca0b 100644 (file)
@@ -4,11 +4,11 @@
   margin-inline: 1.5rem;
 }
 
-.check:has(input:checked) + .form-checked-content {
+.check:checked + .form-checked-content {
   opacity: .5;
 }
 
-.check-input-placeholder input {
+.check-input-placeholder {
   border-style: dashed;
 }
 [contenteditable]:focus {
index 07ba0bc235378e401879ab0c41d58abf51a33617..55b5182c975e7cf9dfcb0ecb9b075775e745050b 100644 (file)
@@ -15,7 +15,7 @@ export const title = 'Bottom navbar example'
   <div class="container-fluid">
     <a class="navbar-brand" href="#">Bottom navbar</a>
     <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
     <div class="collapse navbar-collapse" id="navbarCollapse">
       <ul class="navbar-nav">
index 03a6ac981e5a200d6e0976b0f357ebc5aff52f71..dc13ad1bb895e491c522d2e06a86606806c7b1ce 100644 (file)
@@ -9,7 +9,7 @@ export const extra_css = ['navbar-fixed.css']
   <div class="container-fluid">
     <a class="navbar-brand" href="#">Fixed navbar</a>
     <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
     <div class="collapse navbar-collapse" id="navbarCollapse">
       <ul class="navbar-nav me-auto mb-2 md:mb-0">
index 3e5d2236db7babf911be2431013f8cad16edc387..3f018703567989edd7a9d83a95f0c9fb0c0eaa50 100644 (file)
@@ -9,7 +9,7 @@ export const extra_css = ['navbar-static.css']
   <div class="container-fluid">
     <a class="navbar-brand" href="#">Top navbar</a>
     <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
     <div class="collapse navbar-collapse" id="navbarCollapse">
       <ul class="navbar-nav me-auto mb-2 md:mb-0">
index d3ce1d154524e619dfe9fe016c1b675bef4b3e05..d76ec1055ba3ed721033a7959cd88d982fad8616 100644 (file)
@@ -10,12 +10,12 @@ export const extra_css = ['navbars-drawer.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Dark drawer navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#drawerNavbarDark" aria-controls="drawerNavbarDark" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end text-bg-dark" tabindex="-1" id="drawerNavbarDark" aria-labelledby="drawerNavbarDarkLabel">
         <div class="drawer-header">
           <h5 class="drawer-title" id="drawerNavbarDarkLabel">Drawer</h5>
-          <button type="button" class="btn-close btn-close-white" data-bs-dismiss="drawer" aria-label="Close"></button>
+          <button type="button" class="btn-close" data-bs-dismiss="drawer" aria-label="Close"></button>
         </div>
         <div class="drawer-body">
           <ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
@@ -50,7 +50,7 @@ export const extra_css = ['navbars-drawer.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Light drawer navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#drawerNavbarLight" aria-controls="drawerNavbarLight" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="drawerNavbarLight" aria-labelledby="drawerNavbarLightLabel">
         <div class="drawer-header">
@@ -90,12 +90,12 @@ export const extra_css = ['navbars-drawer.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Responsive drawer navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#drawerNavbar2" aria-controls="drawerNavbar2" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end text-bg-dark" tabindex="-1" id="drawerNavbar2" aria-labelledby="drawerNavbar2Label">
         <div class="drawer-header">
           <h5 class="drawer-title" id="drawerNavbar2Label">Drawer</h5>
-          <button type="button" class="btn-close btn-close-white" data-bs-dismiss="drawer" aria-label="Close"></button>
+          <button type="button" class="btn-close" data-bs-dismiss="drawer" aria-label="Close"></button>
         </div>
         <div class="drawer-body">
           <ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
index f144a9524ce3b7abd103e2615548a5842354544a..05f76e895b56fcc9ed43d6e90197c2568a93de8a 100644 (file)
@@ -10,7 +10,7 @@ export const extra_css = ['navbars.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Never expand</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample01" aria-controls="navbarsExample01" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample01">
@@ -44,7 +44,7 @@ export const extra_css = ['navbars.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Always expand</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample02" aria-controls="navbarsExample02" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample02">
@@ -67,7 +67,7 @@ export const extra_css = ['navbars.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Expand at sm</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample03" aria-controls="navbarsExample03" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample03">
@@ -101,7 +101,7 @@ export const extra_css = ['navbars.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Expand at md</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample04" aria-controls="navbarsExample04" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample04">
@@ -135,7 +135,7 @@ export const extra_css = ['navbars.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Expand at lg</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample05" aria-controls="navbarsExample05" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample05">
@@ -169,7 +169,7 @@ export const extra_css = ['navbars.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Expand at xl</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample06" aria-controls="navbarsExample06" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample06">
@@ -203,7 +203,7 @@ export const extra_css = ['navbars.css']
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Expand at 2xl</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample2xl" aria-controls="navbarsExample2xl" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample2xl">
@@ -237,7 +237,7 @@ export const extra_css = ['navbars.css']
     <div class="container">
       <a class="navbar-brand" href="#">Container</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample07" aria-controls="navbarsExample07" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample07">
@@ -271,7 +271,7 @@ export const extra_css = ['navbars.css']
     <div class="xl:container">
       <a class="navbar-brand" href="#">Container XL</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample07XL" aria-controls="navbarsExample07XL" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExample07XL">
@@ -308,7 +308,7 @@ export const extra_css = ['navbars.css']
   <nav class="navbar lg:navbar-expand navbar-dark bg-dark" aria-label="Tenth navbar example">
     <div class="container-fluid">
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample08" aria-controls="navbarsExample08" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
 
       <div class="collapse navbar-collapse md:justify-content-center" id="navbarsExample08">
@@ -340,7 +340,7 @@ export const extra_css = ['navbars.css']
       <div class="container-fluid">
         <a class="navbar-brand" href="#">Navbar</a>
         <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample09" aria-controls="navbarsExample09" aria-expanded="false" aria-label="Toggle navigation">
-          <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+          <span class="navbar-toggler-icon" aria-hidden="true"></span>
         </button>
 
         <div class="collapse navbar-collapse" id="navbarsExample09">
@@ -373,7 +373,7 @@ export const extra_css = ['navbars.css']
     <nav class="navbar lg:navbar-expand bg-body-tertiary rounded" aria-label="Twelfth navbar example">
       <div class="container-fluid">
         <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample10" aria-controls="navbarsExample10" aria-expanded="false" aria-label="Toggle navigation">
-          <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+          <span class="navbar-toggler-icon" aria-hidden="true"></span>
         </button>
 
         <div class="collapse navbar-collapse md:justify-content-center" id="navbarsExample10">
@@ -403,7 +403,7 @@ export const extra_css = ['navbars.css']
     <nav class="navbar lg:navbar-expand bg-body-tertiary rounded" aria-label="Thirteenth navbar example">
       <div class="container-fluid">
         <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample11" aria-controls="navbarsExample11" aria-expanded="false" aria-label="Toggle navigation">
-          <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+          <span class="navbar-toggler-icon" aria-hidden="true"></span>
         </button>
 
         <div class="collapse navbar-collapse lg:d-flex" id="navbarsExample11">
index 0088675346bbb54a701008cb7788bef5eb8f21f3..a7da1aa77548c2670a6743b6b5962a28f33b74c1 100644 (file)
@@ -23,7 +23,7 @@ export const extra_css = ['product.css']
       Aperture
     </a>
     <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#drawer" aria-controls="drawer" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
     <dialog class="drawer drawer-end" tabindex="-1" id="drawer" aria-labelledby="drawerLabel">
       <div class="drawer-header">
index b6bc65a32c237609a700840b95c4385d47a9c59d..bbf3e0c5fd8add44dd664eacfff44f1e0cb86fd2 100644 (file)
@@ -21,13 +21,7 @@ export const body_class = 'd-flex align-items-center py-4 bg-body-tertiary'
     </div>
 
     <div class="form-field text-start my-3">
-      <div class="check">
-        <input type="checkbox" value="remember-me" id="checkDefault">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-        </svg>
-      </div>
+      <input type="checkbox" value="remember-me" id="checkDefault" class="check">
       <label for="checkDefault">
         Remember me
       </label>
index 5e2754952707c08f77e63b6cbe541a3652a17681..a9137bb7619953d31bf11e6b4d380f5ad9d0db63 100644 (file)
@@ -13,7 +13,7 @@ export const body_class = 'd-flex flex-column h-100'
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Fixed navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <div class="collapse navbar-collapse" id="navbarCollapse">
         <ul class="navbar-nav me-auto mb-2 md:mb-0">
index 92568ce38af07b0d23954afa7e794403abf68c97..4e606f06b24085267f1c5cce03322bb329ede12a 100644 (file)
@@ -5,7 +5,6 @@ import { getVersionedDocsPath } from '@libs/path'
 import type { Layout } from '@libs/layout'
 import BootstrapWhiteFillIcon from '@components/icons/BootstrapWhiteFillIcon.astro'
 import GitHubIcon from '@components/icons/GitHubIcon.astro'
-import HamburgerIcon from '@components/icons/HamburgerIcon.astro'
 import LinkItem from '@components/header/LinkItem.astro'
 import OpenCollectiveIcon from '@components/icons/OpenCollectiveIcon.astro'
 import XIcon from '@components/icons/XIcon.astro'
@@ -141,7 +140,7 @@ const activeSection = !layout ? 'Home' : title === 'Examples' ? 'Examples' : 'Do
           aria-controls="bdSidebar"
           aria-label="Toggle docs navigation"
         >
-          <HamburgerIcon class="navbar-toggler-icon" height={16} width={16} />
+          <span class="navbar-toggler-icon" aria-hidden="true" />
           <span class="d-none fs-6 pe-1">Browse</span>
         </button>
       )
diff --git a/site/src/components/icons/HamburgerIcon.astro b/site/src/components/icons/HamburgerIcon.astro
deleted file mode 100644 (file)
index a5becda..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
----
-import type { SvgIconProps } from '@libs/icon'
-
-type Props = SvgIconProps
-
-const { class: className, height, width } = Astro.props
----
-
-<svg
-  xmlns="http://www.w3.org/2000/svg"
-  fill="currentColor"
-  viewBox="0 0 16 16"
-  class={className}
-  height={height}
-  width={width}
-  aria-hidden="true"
-  stroke="currentColor"
-  stroke-width="1"
-  stroke-linecap="round"
->
-  <path d="M1 3.5h14M1 8h14M1 12.5h14"></path>
-</svg>
index d7c33d59b3f2b70669183a866155ac83182ddb8b..95933d5b568f7239010a16dd23dce54a8b6f6409 100644 (file)
@@ -24,11 +24,4 @@ const { class: className, dismiss, target } = Astro.props
   class:list={['btn-close', className]}
   data-bs-dismiss={dismiss}
   aria-label="Close"
-  data-bs-target={target}
->
-  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="none">
-    <path
-      d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm3.354 4.646L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 1 1 .708-.708"
-    ></path>
-  </svg>
-</button>
+  data-bs-target={target}></button>
index 2302794522473be21bc00dbab2e1f1826079549a..a72981569b982b94f1189c49000473b794535d86 100644 (file)
@@ -7,22 +7,18 @@ css_layer: components
 
 ## Example
 
-Use an ordered list with `.breadcrumb-item` for each page and `.breadcrumb-divider` elements containing your separator icon. Add `.active` to the `.breadcrumb-link` of the current page.
+Use an ordered list with `.breadcrumb-item` for each page and `.breadcrumb-divider` elements between them. Leave a divider empty to use the default chevron icon, or add your own separator content. Add `.active` to the `.breadcrumb-link` of the current page.
 
 <Example code={`<nav aria-label="breadcrumb">
     <ol class="breadcrumb">
       <li class="breadcrumb-item">
         <a class="breadcrumb-link" href="#">Home</a>
       </li>
-      <li class="breadcrumb-divider">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 16" width="6" height="12"><path d="M2 2l4 6-4 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
-      </li>
+      <li class="breadcrumb-divider"></li>
       <li class="breadcrumb-item">
         <a class="breadcrumb-link" href="#">Library</a>
       </li>
-      <li class="breadcrumb-divider">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 16" width="6" height="12"><path d="M2 2l4 6-4 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
-      </li>
+      <li class="breadcrumb-divider"></li>
       <li class="breadcrumb-item" aria-current="page">
         <a class="breadcrumb-link active" href="#">Data</a>
       </li>
@@ -34,23 +30,17 @@ Use an ordered list with `.breadcrumb-item` for each page and `.breadcrumb-divid
       <li class="breadcrumb-item">
         <a class="breadcrumb-link" href="#">Home</a>
       </li>
-      <li class="breadcrumb-divider">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 16" width="6" height="12"><path d="M2 2l4 6-4 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
-      </li>
+      <li class="breadcrumb-divider"></li>
       <li class="breadcrumb-item">
         <a class="breadcrumb-link" href="#">
           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor"><circle cx="2" cy="8" r="2"/><circle cx="8" cy="8" r="2"/><circle cx="14" cy="8" r="2"/></svg>
         </a>
       </li>
-      <li class="breadcrumb-divider">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 16" width="6" height="12"><path d="M2 2l4 6-4 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
-      </li>
+      <li class="breadcrumb-divider"></li>
       <li class="breadcrumb-item">
         <a class="breadcrumb-link" href="#">Documents</a>
       </li>
-      <li class="breadcrumb-divider">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 16" width="6" height="12"><path d="M2 2l4 6-4 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
-      </li>
+      <li class="breadcrumb-divider"></li>
       <li class="breadcrumb-item" aria-current="page">
         <a class="breadcrumb-link active" href="#">2026</a>
       </li>
@@ -59,11 +49,27 @@ Use an ordered list with `.breadcrumb-item` for each page and `.breadcrumb-divid
 
 ## Dividers
 
-Dividers are added explicitly using `.breadcrumb-divider` elements. This gives you full control over the separator—use any SVG icon, text character, or custom content.
+Dividers are added explicitly using `.breadcrumb-divider` elements. An empty divider renders a default chevron, drawn with a CSS [`mask`]([[docsref:/customize/sass/#mask-icons]]) so it inherits the divider color (including in dark mode). To use a different separator, add your own content—any SVG icon, text character, or custom markup—which overrides the default.
+
+### Default divider
+
+Leave the `.breadcrumb-divider` empty to get the built-in chevron. Customize it globally by overriding the `--bs-breadcrumb-divider-icon`, `--bs-breadcrumb-divider-width`, and `--bs-breadcrumb-divider-height` variables.
+
+<Example code={`<nav aria-label="breadcrumb">
+    <ol class="breadcrumb">
+      <li class="breadcrumb-item">
+        <a class="breadcrumb-link" href="#">Home</a>
+      </li>
+      <li class="breadcrumb-divider"></li>
+      <li class="breadcrumb-item" aria-current="page">
+        <a class="breadcrumb-link active" href="#">Library</a>
+      </li>
+    </ol>
+  </nav>`} />
 
 ### SVG dividers
 
-Use inline SVG for crisp, scalable dividers that inherit `currentColor` for easy theming.
+Add an inline SVG inside the divider to override the default with your own crisp, scalable icon. Use `currentColor` for the stroke or fill so it inherits the divider color for easy theming.
 
 <Example code={`<nav aria-label="breadcrumb">
     <ol class="breadcrumb">
@@ -71,7 +77,10 @@ Use inline SVG for crisp, scalable dividers that inherit `currentColor` for easy
         <a class="breadcrumb-link" href="#">Home</a>
       </li>
       <li class="breadcrumb-divider">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 16" width="6" height="12"><path d="M2 2l4 6-4 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
+        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi" viewBox="0 0 16 16">
+          <path fill-rule="evenodd" d="M3.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L9.293 8 3.646 2.354a.5.5 0 0 1 0-.708"/>
+          <path fill-rule="evenodd" d="M7.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L13.293 8 7.646 2.354a.5.5 0 0 1 0-.708"/>
+        </svg>
       </li>
       <li class="breadcrumb-item" aria-current="page">
         <a class="breadcrumb-link active" href="#">Library</a>
index b2d6e3e2cd29347dac514d30137dc3afd18a59c3..843b07d06af89c8a84845f18b766c2d2e5e6cbb0 100644 (file)
@@ -7,39 +7,23 @@ css_layer: components
 
 ## Example
 
-Provide an option to dismiss or close a component with `.btn-close`. Requires the use of an SVG icon within, which inherits the `color` from the `.btn-close` class. **Be sure to include text for screen readers**, as we’ve done with `aria-label`.
+Provide an option to dismiss or close a component with `.btn-close`. The icon is rendered with a CSS `mask-image`, so it inherits the `color` from the `.btn-close` class—no inline SVG required. **Be sure to include text for screen readers**, as we’ve done with `aria-label`.
 
-<Example code={`<button type="button" class="btn-close" aria-label="Close">
-    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="none">
-      <path fill="currentcolor" d="M12 0a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4zm-.646 4.646a.5.5 0 0 0-.707 0L8 7.293 5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.647a.5.5 0 1 0 .708.707L8 8.707l2.647 2.646a.5.5 0 1 0 .707-.707L8.707 8l2.646-2.646a.5.5 0 0 0 0-.708z"/>
-    </svg>
-  </button>`} />
+<Example code={`<button type="button" class="btn-close" aria-label="Close"></button>`} />
 
 ## Disabled state
 
 Disabled close buttons change their `opacity`. We’ve also applied `pointer-events: none` and `user-select: none` to preventing hover and active states from triggering.
 
-<Example code={`<button type="button" class="btn-close" disabled aria-label="Close">
-    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="none">
-      <path fill="currentcolor" d="M12 0a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4zm-.646 4.646a.5.5 0 0 0-.707 0L8 7.293 5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.647a.5.5 0 1 0 .708.707L8 8.707l2.647 2.646a.5.5 0 1 0 .707-.707L8.707 8l2.646-2.646a.5.5 0 0 0 0-.708z"/>
-    </svg>
-  </button>`} />
+<Example code={`<button type="button" class="btn-close" disabled aria-label="Close"></button>`} />
 
 ## Dark variant
 
 Add `data-bs-theme="dark"` to the `.btn-close`, or to its parent element, to invert the close button. This happens automatically when in dark mode.
 
 <Example class="bg-inverse" code={`<div data-bs-theme="dark">
-    <button type="button" class="btn-close" aria-label="Close">
-      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="none">
-        <path fill="currentcolor" d="M12 0a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4zm-.646 4.646a.5.5 0 0 0-.707 0L8 7.293 5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.647a.5.5 0 1 0 .708.707L8 8.707l2.647 2.646a.5.5 0 1 0 .707-.707L8.707 8l2.646-2.646a.5.5 0 0 0 0-.708z"/>
-      </svg>
-    </button>
-    <button type="button" class="btn-close" disabled aria-label="Close">
-      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="none">
-        <path fill="currentcolor" d="M12 0a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4zm-.646 4.646a.5.5 0 0 0-.707 0L8 7.293 5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.647a.5.5 0 1 0 .708.707L8 8.707l2.647 2.646a.5.5 0 1 0 .707-.707L8.707 8l2.646-2.646a.5.5 0 0 0 0-.708z"/>
-      </svg>
-    </button>
+    <button type="button" class="btn-close" aria-label="Close"></button>
+    <button type="button" class="btn-close" disabled aria-label="Close"></button>
   </div>`} />
 
 ## CSS
index ba40744078f84bf22b437c9dbe656c8ac0c6571f..bbc26475730c15da07a4ad29f6edabce2bfbc9d2 100644 (file)
@@ -209,37 +209,19 @@ Place Bootstrap’s checkboxes and radios within list group items and customize
 <Example code={`<ul class="list-group">
     <li class="list-group-item">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" value="" id="firstCheckbox">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-          </svg>
-        </div>
+        <input type="checkbox" value="" id="firstCheckbox" class="check">
         <label for="firstCheckbox">First checkbox</label>
       </div>
     </li>
     <li class="list-group-item">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" value="" id="secondCheckbox">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-          </svg>
-        </div>
+        <input type="checkbox" value="" id="secondCheckbox" class="check">
         <label for="secondCheckbox">Second checkbox</label>
       </div>
     </li>
     <li class="list-group-item">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" value="" id="thirdCheckbox">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-          </svg>
-        </div>
+        <input type="checkbox" value="" id="thirdCheckbox" class="check">
         <label for="thirdCheckbox">Third checkbox</label>
       </div>
     </li>
@@ -247,16 +229,22 @@ Place Bootstrap’s checkboxes and radios within list group items and customize
 
 <Example code={`<ul class="list-group">
     <li class="list-group-item">
-      <input class="radio me-1" type="radio" name="listGroupRadio" value="" id="firstRadio" checked>
-      <label for="firstRadio">First radio</label>
+      <div class="form-field">
+        <input type="radio" name="listGroupRadio" value="" id="firstRadio" class="radio" checked>
+        <label for="firstRadio">First radio</label>
+      </div>
     </li>
     <li class="list-group-item">
-      <input class="radio me-1" type="radio" name="listGroupRadio" value="" id="secondRadio">
-      <label for="secondRadio">Second radio</label>
+      <div class="form-field">
+        <input type="radio" name="listGroupRadio" value="" id="secondRadio" class="radio">
+        <label for="secondRadio">Second radio</label>
+      </div>
     </li>
     <li class="list-group-item">
-      <input class="radio me-1" type="radio" name="listGroupRadio" value="" id="thirdRadio">
-      <label for="thirdRadio">Third radio</label>
+      <div class="form-field">
+        <input type="radio" name="listGroupRadio" value="" id="thirdRadio" class="radio">
+        <label for="thirdRadio">Third radio</label>
+      </div>
     </li>
   </ul>`} />
 
@@ -265,37 +253,19 @@ You can use `.stretched-link` on `<label>`s to make the whole list group item cl
 <Example code={`<ul class="list-group">
     <li class="list-group-item">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" value="" id="firstCheckboxStretched">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-          </svg>
-        </div>
+        <input type="checkbox" value="" id="firstCheckboxStretched" class="check">
         <label class="stretched-link" for="firstCheckboxStretched">First checkbox</label>
       </div>
     </li>
     <li class="list-group-item">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" value="" id="secondCheckboxStretched">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-          </svg>
-        </div>
+        <input type="checkbox" value="" id="secondCheckboxStretched" class="check">
         <label class="stretched-link" for="secondCheckboxStretched">Second checkbox</label>
       </div>
     </li>
     <li class="list-group-item">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" value="" id="thirdCheckboxStretched">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-          </svg>
-        </div>
+        <input type="checkbox" value="" id="thirdCheckboxStretched" class="check">
         <label class="stretched-link" for="thirdCheckboxStretched">Third checkbox</label>
       </div>
     </li>
index b4233159caa577e14141e5eaeef7481f1ef86bcc..622d9d0472da30443376872c107eec024323dcaa 100644 (file)
@@ -358,13 +358,7 @@ Put a form within a menu, or make it into a menu, and use [margin]([[docsref:/ut
         <input type="password" class="form-control" id="exampleMenuFormPassword1" placeholder="Password">
       </div>
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" id="checkLabel" />
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M5 8h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="checkLabel" class="check" />
         <label for="checkLabel">Example new checkbox</label>
       </div>
       <div class="vstack gap-2">
index 1e8d6a7558cca44a04b3c17fb2a554db1da3561a..075fbd15ac4a86d60a5f4d7243ff75142e3e8ac0 100644 (file)
@@ -21,9 +21,7 @@ Here’s a navbar that includes most supported sub-components and a responsive r
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarDrawer" aria-controls="navbarDrawer" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round">
-          <path d="M1 3.5h14M1 8h14M1 12.5h14"/>
-        </svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarDrawer" aria-labelledby="navbarDrawerLabel">
         <div class="drawer-header">
@@ -146,7 +144,7 @@ Please note that you should also add the `aria-current` attribute on the active
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarNav" aria-labelledby="navbarNavLabel">
         <div class="drawer-header">
@@ -179,7 +177,7 @@ And because we use classes for our navs, you can avoid the list-based approach e
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarNavAltMarkup" aria-labelledby="navbarNavAltMarkupLabel">
         <div class="drawer-header">
@@ -204,7 +202,7 @@ You can also use menus in your navbar. Menus require a wrapping element for posi
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarNavMenu" aria-controls="navbarNavMenu" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarNavMenu" aria-labelledby="navbarNavMenuLabel">
         <div class="drawer-header">
@@ -301,7 +299,7 @@ Mix and match with other components and utilities as needed.
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Navbar w/ text</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarText" aria-labelledby="navbarTextLabel">
         <div class="drawer-header">
@@ -336,9 +334,7 @@ To make a navbar dark, add `data-bs-theme="dark"` to the `.navbar` element.
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Dark navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarDarkDrawer" aria-controls="navbarDarkDrawer" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round">
-          <path d="M1 3.5h14M1 8h14M1 12.5h14"/>
-        </svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarDarkDrawer" aria-labelledby="navbarDarkDrawerLabel">
         <div class="drawer-header">
@@ -409,7 +405,7 @@ Navbar themes are easier than ever thanks to Bootstrap’s combination of Sass a
   <div class="container-fluid">
     <a class="navbar-brand" href="#">Navbar</a>
     <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
     <dialog class="drawer drawer-end" tabindex="-1" id="navbarColor01" aria-labelledby="navbarColor01Label">
       <div class="drawer-header">
@@ -444,7 +440,7 @@ Navbar themes are easier than ever thanks to Bootstrap’s combination of Sass a
   <div class="container-fluid">
     <a class="navbar-brand" href="#">Navbar</a>
     <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
     <dialog class="drawer drawer-end" tabindex="-1" id="navbarColor02" aria-labelledby="navbarColor02Label">
       <div class="drawer-header">
@@ -479,7 +475,7 @@ Navbar themes are easier than ever thanks to Bootstrap’s combination of Sass a
   <div class="container-fluid">
     <a class="navbar-brand" href="#">Navbar</a>
     <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
-      <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+      <span class="navbar-toggler-icon" aria-hidden="true"></span>
     </button>
     <dialog class="drawer drawer-end" tabindex="-1" id="navbarColor03" aria-labelledby="navbarColor03Label">
       <div class="drawer-header">
@@ -578,7 +574,7 @@ These examples omit the `.lg:navbar-expand` class to always show the drawer beha
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Left Drawer</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarLeftDrawer" aria-controls="navbarLeftDrawer" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-start" tabindex="-1" id="navbarLeftDrawer" aria-labelledby="navbarLeftDrawerLabel">
         <div class="drawer-header">
@@ -600,7 +596,7 @@ These examples omit the `.lg:navbar-expand` class to always show the drawer beha
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Top Drawer</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarTopDrawer" aria-controls="navbarTopDrawer" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-top" tabindex="-1" id="navbarTopDrawer" aria-labelledby="navbarTopDrawerLabel">
         <div class="drawer-header">
@@ -629,7 +625,7 @@ With no `.navbar-brand` shown (hidden inside the drawer):
 <ResizableExample code={`<nav class="navbar md:navbar-expand bg-1 fg-2">
     <div class="container-fluid">
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarTogglerDemo01" aria-labelledby="navbarTogglerDemo01Label">
         <div class="drawer-header">
@@ -658,7 +654,7 @@ With a brand name shown on the left and toggler on the right:
     <div class="container-fluid">
       <a class="navbar-brand" href="#">Navbar</a>
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarTogglerDemo02" aria-labelledby="navbarTogglerDemo02Label">
         <div class="drawer-header">
@@ -685,7 +681,7 @@ With a toggler on the left and brand name on the right:
 <ResizableExample code={`<nav class="navbar bg-1 fg-2">
     <div class="container-fluid">
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
       <a class="navbar-brand" href="#">Navbar</a>
       <dialog class="drawer drawer-end" tabindex="-1" id="navbarTogglerDemo03" aria-labelledby="navbarTogglerDemo03Label">
@@ -724,7 +720,7 @@ Sometimes you want to use the drawer plugin to trigger a container element for c
   <nav class="navbar bg-body" data-bs-theme="dark">
     <div class="container-fluid">
       <button class="btn-icon navbar-toggler" type="button" data-bs-toggle="drawer" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
-        <svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
+        <span class="navbar-toggler-icon" aria-hidden="true"></span>
       </button>
     </div>
   </nav>`} />
index 387432875dce2edfddaa2846e46dc16d3cbb34fb..a9da65baef5eeb91b71d4f1f715e20215cd9c3f7 100644 (file)
@@ -546,3 +546,27 @@ The `generate-theme-classes()` mixin loops over the `$theme-colors` map and outp
 // .theme-success { --theme-base: var(--success-base); --theme-bg: var(--success-bg); ... }
 // ...
 ```
+
+### Mask icons
+
+The `mask-icon()` mixin renders an SVG icon via a CSS [`mask`](https://developer.mozilla.org/en-US/docs/Web/CSS/mask) so the shape is painted with the element’s `background-color`. This lets an icon inherit the current text color, enabling automatic dark mode without a separate SVG. We use this for the [close button]([[docsref:/components/close-button/]]), [navbar toggler]([[docsref:/components/navbar/]]), [checkbox marks]([[docsref:/forms/checkbox/]]), [breadcrumb dividers]([[docsref:/components/breadcrumb/]]), [datepicker arrows]([[docsref:/forms/datepicker/]]), and [carousel controls]([[docsref:/components/carousel/]]).
+
+Some form controls can’t use `mask` because they don’t support pseudo-elements and masking would clip the whole field. The `<select>` chevron and inputs using `.form-control-caret` are two examples, which keep separate light and dark `background-image` SVGs instead as non-masked background images.
+
+<ScssDocs name="mask-icon-mixin" file="scss/mixins/_mask-icon.scss" />
+
+Set `background-color` on the element yourself (the mixin only outputs the `mask-*` properties), then pass your icon as the mask image. Pass `null` for the icon when it’s applied conditionally, such as per state or direction.
+
+```scss
+.custom-icon {
+  // Declare a custom CSS variable for the icon. This could be on the same
+  // element, `:root`, or a parent element. We're using a custom × icon. Be
+  // sure to wrap in `escape-svg()` as well.
+  --custom-icon: #{escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-linecap='round' stroke-width='2' d='m4 4 8 8m0-8-8 8'/></svg>"))};
+
+  width: 1rem;
+  height: 1rem;
+  background-color: currentcolor;
+  @include mask-icon($icon: var(--custom-icon));
+}
+```
index 32c9de2664020728d837840a97366bf7419c50ad..f6b1e4f5c195d9a39bc63ae1f75a15a89faf4379 100644 (file)
@@ -214,13 +214,7 @@ Here’s the same set of components rendered in both light and dark modes side b
       <div class="alert theme-primary"><p>This is a primary alert.</p></div>
       <input type="text" class="form-control" placeholder="Form control">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" id="checkLabel" />
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="checkLabel" class="check" />
         <label class="form-label" for="checkLabel">Example new checkbox</label>
       </div>
       <div class="vstack gap-2">
@@ -239,13 +233,7 @@ Here’s the same set of components rendered in both light and dark modes side b
       <div class="alert theme-primary"><p>This is a primary alert.</p></div>
       <input type="text" class="form-control" placeholder="Form control">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" id="checkDarkLabel" />
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="checkDarkLabel" class="check" />
         <label class="form-label" for="checkDarkLabel">Example new checkbox</label>
       </div>
       <div class="vstack gap-2">
index 63a35084fe58020fe1767278c5ee645de0b10160..40b0309020d3d8addd07158c4fd9b744c7b9ad72 100644 (file)
@@ -10,48 +10,29 @@ import { getData } from '@libs/data'
 
 ## Basic checkbox
 
-All checkbox styling is contained to a wrapper class, `.check`. This does the following:
+All checkbox styling is applied with the `.check` class directly on the `<input>`. This does the following:
 
-- Adds a stacking grid layout for the checkbox and custom SVG icon.
 - Overrides the default `<input>` appearance with themed colors.
-- Handles the toggling of separate paths in our custom SVG for the `:checked` and indeterminate states. Two `<path>`s are included in the SVG, one for each state, and the appropriate `<path>` is shown based on the `<input>`’s state.
+- Renders the `:checked` and indeterminate icons via a CSS `mask` on the input’s `::before` pseudo-element, so the mark inherits the contrast color and no inline SVG is needed. The appropriate icon is shown based on the input’s state.
 
-For folks looking to replace our provided icons, you’ll need to add the `.checked` and `.indeterminate` classes to the `<path>`s and use them in a single `<svg>` element.
+For folks looking to replace our provided icons, override the `--bs-check-icon-checked` and `--bs-check-icon-indeterminate` CSS variables (or the `--check-icon-*` Sass tokens) with your own `mask-image` URLs.
 
-Checkbox layout and labels are handled with additional HTML and CSS.
+Labels and layout are handled with additional HTML and CSS.
 
-<Example code={`<div class="check">
-    <input type="checkbox" id="check" checked />
-    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-      <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-      <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-    </svg>
-  </div>`} />
+<Example code={`<input type="checkbox" id="check" class="check" checked />`} />
 
 ## Indeterminate
 
 Checkboxes can utilize the indeterminate pseudo class when manually set via JavaScript. There is no available HTML attribute for specifying it.
 
-<Example addStackblitzJs class="bd-example-indeterminate" code={`<div class="check">
-    <input type="checkbox" id="checkIndeterminate" />
-    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-      <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-      <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-    </svg>
-  </div>`} />
+<Example addStackblitzJs class="bd-example-indeterminate" code={`<input type="checkbox" id="checkIndeterminate" class="check" />`} />
 
 ## With form field
 
 Wrap the `.check` in a `.form-field` layout wrapper and add your label. The grid layout places the checkbox and label side by side.
 
 <Example code={`<div class="form-field">
-    <div class="check">
-      <input type="checkbox" id="checkLabel" />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="checkLabel" class="check" />
     <label for="checkLabel">Example new checkbox</label>
   </div>`} />
 
@@ -60,13 +41,7 @@ Wrap the `.check` in a `.form-field` layout wrapper and add your label. The grid
 Add a description or other content after the label. We recommend wrapping the label and description in a `.form-field-content` to ensure appropriate spacing and alignment.
 
 <Example code={`<div class="form-field">
-    <div class="check">
-      <input type="checkbox" id="checkDescription" />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="checkDescription" class="check" />
     <div class="form-field-content">
       <label for="checkDescription">Example new checkbox</label>
       <small class="form-text">Supporting description for the above label.</small>
@@ -78,13 +53,7 @@ Add a description or other content after the label. We recommend wrapping the la
 Modify the appearance of checked checkboxes by adding the `.theme-{color}` class to the `.check` element. This will set the checked background and border color to the theme color.
 
 <Example class="d-flex flex-column gap-2" code={getData('theme-colors').map((themeColor) => `<div class="form-field">
-    <div class="check theme-${themeColor.name}">
-      <input type="checkbox" id="check${themeColor.name}" checked />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="check${themeColor.name}" class="check theme-${themeColor.name}" checked />
     <label for="check${themeColor.name}">Example ${themeColor.name} checkbox</label>
   </div>`)} />
 
@@ -93,26 +62,14 @@ Modify the appearance of checked checkboxes by adding the `.theme-{color}` class
 Add the `disabled` attribute and the associated `<label>`s are automatically styled to match with a lighter color to help indicate the input’s state.
 
 <Example code={`<div class="form-field">
-    <div class="check">
-      <input type="checkbox" id="checkDisabled" disabled />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="checkDisabled" class="check" disabled />
     <label for="checkDisabled">Example new checkbox</label>
   </div>`} />
 
 Applies to checked states, too.
 
 <Example code={`<div class="form-field">
-    <div class="check">
-      <input type="checkbox" id="checkDisabledChecked" checked disabled />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="checkDisabledChecked" class="check" checked disabled />
     <label for="checkDisabledChecked">Example new checkbox</label>
   </div>`} />
 
@@ -120,27 +77,9 @@ Applies to checked states, too.
 
 Add `.check-sm` or `.check-lg` to make your checkbox appear smaller or larger.
 
-<Example class="d-flex flex-column gap-3" code={`<div class="check check-sm">
-    <input type="checkbox" id="checkSizeSm" checked />
-    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-      <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-      <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-    </svg>
-  </div>
-  <div class="check">
-    <input type="checkbox" id="checkSizeMd" checked />
-    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-      <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-      <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-    </svg>
-  </div>
-  <div class="check check-lg">
-    <input type="checkbox" id="checkSizeLg" checked />
-    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-      <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-      <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-    </svg>
-  </div>`} />
+<Example class="d-flex flex-column gap-3" code={`<input type="checkbox" id="checkSizeSm" class="check check-sm" checked />
+  <input type="checkbox" id="checkSizeMd" class="check" checked />
+  <input type="checkbox" id="checkSizeLg" class="check check-lg" checked />`} />
 
 ## CSS
 
index 9148d2de1659356adfd28e22caa6a86fa7a053da..f9e942f26754d4d7ac1200e44fb3cf21920280c2 100644 (file)
@@ -61,13 +61,7 @@ Works the same way with `<textarea>` elements. Descriptions are optional.
 When a `.check` is a direct child, the grid switches to a two-column layout with the checkbox in column 1 and the label in column 2.
 
 <Example code={`<div class="form-field">
-    <div class="check">
-      <input type="checkbox" id="fieldCheck" />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="fieldCheck" class="check" />
     <label for="fieldCheck">Remember me</label>
   </div>`} />
 
@@ -163,13 +157,7 @@ When a check, radio, or switch needs a field title above it, add a `.form-label`
 
 <Example code={`<div class="form-field">
     <label class="form-label">Terms and conditions</label>
-    <div class="check">
-      <input type="checkbox" id="fieldOverheadCheck" required />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="fieldOverheadCheck" class="check" required />
     <div class="form-field-content">
       <label for="fieldOverheadCheck">I agree to the terms</label>
       <small class="form-text">Please read before agreeing.</small>
@@ -181,13 +169,7 @@ When a check, radio, or switch needs a field title above it, add a `.form-label`
 Add a `<small class="form-text">` after the label and wrap it in a `.form-field-content` to ensure appropriate spacing and alignment.
 
 <Example class="d-flex flex-column gap-3" code={`<div class="form-field">
-    <div class="check">
-      <input type="checkbox" id="fieldCheckDesc" />
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="fieldCheckDesc" class="check" />
     <div class="form-field-content">
       <label for="fieldCheckDesc">Subscribe to updates</label>
       <small class="form-text">We’ll send you a weekly digest of what’s new.</small>
@@ -222,13 +204,7 @@ Add `data-bs-validate` to your `<form>` to opt in to `:user-invalid` styling. Th
       <div class="valid-feedback">Looks good!</div>
     </div>
     <div class="form-field">
-      <div class="check">
-        <input type="checkbox" id="fieldValidateCheck" required>
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" id="fieldValidateCheck" class="check" required>
       <div class="form-field-content">
         <label for="fieldValidateCheck">Agree to terms and conditions</label>
         <div class="invalid-feedback">You must agree before submitting.</div>
@@ -252,13 +228,7 @@ Apply `.is-invalid` or `.is-valid` directly to the control for server-side valid
     <div class="valid-feedback">Looks good!</div>
   </div>
   <div class="form-field mb-3">
-    <div class="check">
-      <input type="checkbox" id="fieldServerCheck" class="is-invalid" required>
-      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-        <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-        <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-      </svg>
-    </div>
+    <input type="checkbox" id="fieldServerCheck" class="check is-invalid" required>
     <label for="fieldServerCheck">Agree to terms and conditions</label>
     <div class="invalid-feedback">You must agree before submitting.</div>
   </div>
index 94899beb282535c653dfbc810d68d48e6ab0d17c..5ccaed3906e9cbca2c233341c0a7ac124587fa91 100644 (file)
@@ -122,13 +122,7 @@ Place any checkbox or radio within an input group’s addon instead of text.
 
 <Example code={`<div class="input-group mb-3">
     <div class="input-group-text">
-      <div class="check">
-        <input type="checkbox" aria-label="Checkbox for following text input">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5.5 10.5h8'/>
-        </svg>
-      </div>
+      <input type="checkbox" class="check" aria-label="Checkbox for following text input">
     </div>
     <input type="text" class="form-control" aria-label="Text input with checkbox">
   </div>
index e5521bca59ba8e4d8d20a24392ce1c0cdac258d0..790731fc7f507677b7c0666e3edf873c60de0543 100644 (file)
@@ -90,13 +90,7 @@ More complex layouts can also be created with the grid system.
     </div>
     <div class="col-12">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" id="gridCheck">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="gridCheck" class="check">
         <label for="gridCheck">
           Check me out
         </label>
@@ -154,13 +148,7 @@ At times, you maybe need to use margin or padding utilities to create that perfe
     <div class="row mb-3">
       <div class="sm:col-10 sm:offset-2">
         <div class="form-field">
-          <div class="check">
-            <input type="checkbox" id="gridCheck1">
-            <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-              <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-              <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-            </svg>
-          </div>
+          <input type="checkbox" id="gridCheck1" class="check">
           <label for="gridCheck1">
             Example checkbox
           </label>
@@ -236,13 +224,7 @@ The example below uses a flexbox utility to vertically center the contents and c
     </div>
     <div class="col-auto">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" id="autoSizingCheck">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="autoSizingCheck" class="check">
         <label for="autoSizingCheck">
           Remember me
         </label>
@@ -278,13 +260,7 @@ You can then remix that once again with size-specific column classes.
     </div>
     <div class="col-auto">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" id="autoSizingCheck2">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="autoSizingCheck2" class="check">
         <label for="autoSizingCheck2">
           Remember me
         </label>
@@ -320,13 +296,7 @@ Use the `.row-cols-*` classes to create responsive horizontal layouts. By adding
 
     <div class="col-12">
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" id="inlineFormCheck">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="inlineFormCheck" class="check">
         <label for="inlineFormCheck">
           Remember me
         </label>
index b2e8bb501275f6db775527c99839ce8012029cf4..c88e055ffb4e10bccf8cee3ddfdc607c5556a573 100644 (file)
@@ -44,13 +44,7 @@ Here’s a quick example to demonstrate Bootstrap’s form styles. Keep reading
       <input type="password" class="form-control" id="exampleInputPassword1">
     </div>
     <div class="mb-3 form-field">
-      <div class="check">
-        <input type="checkbox" id="exampleCheck1">
-        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-          <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-          <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-        </svg>
-      </div>
+      <input type="checkbox" id="exampleCheck1" class="check">
       <label for="exampleCheck1">Check me out</label>
     </div>
     <button type="submit" class="btn-solid theme-primary">Submit</button>
@@ -82,13 +76,7 @@ However, if your form also includes custom button-like elements such as `<a clas
         </select>
       </div>
       <div class="mb-3 form-field">
-        <div class="check">
-          <input type="checkbox" id="disabledFieldsetCheck" disabled>
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" id="disabledFieldsetCheck" class="check" disabled>
         <label for="disabledFieldsetCheck">
           Can’t check this
         </label>
index 9c8900639a0b2d28bf9873f1cd100b038ea4c063..43dee7092d70653f3cd1b56e1d6bdee562d7a32a 100644 (file)
@@ -290,13 +290,7 @@ Validation styles are available for the following form controls and components:
     <div class="form-group">
       <label class="form-label">Checkbox</label>
       <div class="form-field">
-        <div class="check">
-          <input type="checkbox" class="is-invalid" id="validationFormCheck1" required aria-describedby="validationFormCheck1Feedback">
-          <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>
-            <path class="checked" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 8 3 3 5-5'/>
-            <path class="indeterminate" fill='none' stroke='currentcolor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4.5 8.5h6'/>
-          </svg>
-        </div>
+        <input type="checkbox" class="check is-invalid" id="validationFormCheck1" required aria-describedby="validationFormCheck1Feedback">
         <div class="form-field-content">
           <label for="validationFormCheck1">Check this checkbox</label>
           <div id="validationFormCheck1Feedback" class="invalid-feedback">Example invalid feedback text</div>
index c6ae573ebaf55c35757a93a653327d05551a06af..c529818fd18a044127f1509d581c54636bdde39d 100644 (file)
@@ -106,7 +106,7 @@ Bootstrap 6 is a major release with many breaking changes to modernize our codeb
   - Removed `$nested-kbd-font-weight`, no replacement.
   - Removed `muted`, `black-50`, and `white-50` from text colors utilities map
   - Consolidated carousel dark variables, removing `$carousel-dark-indicator-active-bg`, `$carousel-dark-caption-color`, and `$carousel-dark-control-icon-filter` for their reassigned counterparts.
-  - Removed `$btn-close-white-filter` for `$btn-close-filter-dark`.
+  - Removed `$btn-close-white-filter`. The close button no longer uses a filter—its icon is a CSS mask painted with `currentcolor`, so it adapts to dark backgrounds automatically.
   - Removed `$border-radius-xxl`, use `$border-radius-2xl`.
   - Removed `$text-muted` for secondary color.
   - Removed `$hr-bg-color` for `$hr-border-color` and `$hr-height` for `$hr-border-width`.
@@ -206,10 +206,11 @@ Bootstrap 6 is a major release with many breaking changes to modernize our codeb
   - The expand/collapse icon now uses an `.accordion-icon` element (typically an SVG) inside the summary, replacing the CSS `background-image` approach.
   - Open state styling uses `details[open]` instead of JavaScript-toggled classes.
   - Theme coloring via `.theme-*` classes on the `.accordion` wrapper.
-- **Rebuilt close button markup.** `.btn-close` now expects a child `<svg>` element with `fill: currentcolor` instead of the v5 `background-image` encoded SVG. The filter-based dark mode approach (`$btn-close-white-filter`) has been replaced by `currentcolor` inheritance.
+- **Rebuilt close button markup.** `.btn-close` now renders its icon via a CSS `mask-image` (`--btn-close-icon`) tinted with `background-color: currentcolor`, so the button is self-contained—no child `<svg>` is required. The filter-based dark mode approach (`$btn-close-white-filter`) has been replaced by `currentcolor` inheritance, and the `.btn-close-white` class has been removed—on dark backgrounds (e.g., `.text-bg-dark`) the icon now inherits the contrast color automatically.
 - **Restructured cards.** Borders now live on `.card-body` and `.card-list` segments rather than a single outer `.card` border. Added `--card-box-shadow` and `--card-body-gap` tokens. New variant classes: `.card-translucent` (frosted glass effect) and `.card-subtle` (themed with subtle backgrounds). Horizontal cards use a new `.card-row` class.
 - **Reworked badge variants.** Badge color variants now use `.badge-subtle` and `.badge-outline` combined with `.theme-*` classes (e.g., `.badge-subtle .theme-primary`), replacing the v5 `.bg-primary` utility pattern on badges.
-- **Updated breadcrumb markup.** Breadcrumbs now use `.breadcrumb-link` as an interactive element with padding, min-height, and hover background, and `.breadcrumb-divider` as a visible separator element between items. The v5 `::before` pseudo-element divider pattern has been removed.
+- **Updated breadcrumb markup.** Breadcrumbs now use `.breadcrumb-link` as an interactive element with padding, min-height, and hover background, and explicit `.breadcrumb-divider` elements as separators between items. An empty `.breadcrumb-divider` renders a default chevron via a CSS `mask-image` (`--breadcrumb-divider-icon`) tinted with `background-color: currentcolor`; add your own SVG, text, or markup inside it to override. This replaces the v5 `--bs-breadcrumb-divider` content string on the `.breadcrumb-item::before` pseudo-element.
+- **Navbar toggler icon now uses a CSS mask.** `.navbar-toggler-icon` renders via `mask-image` (`--navbar-toggler-icon`) tinted with `background-color: currentcolor` instead of an embedded `background-image` SVG. The markup stays an empty `<span class="navbar-toggler-icon">`, but the icon now inherits the current text color (including dark mode), so the separate light/dark toggler SVGs are no longer needed.
 
 ### Reboot
 
@@ -225,7 +226,7 @@ Bootstrap 6 is a major release with many breaking changes to modernize our codeb
   - Also split apart the documentation pages for checks, radios, and switches.
   - Added new CSS variables on each of these components. _Side note: we could’ve shared variables here, but chose not to for simplicity’s sake._
   - Removed several now unused Sass variables.
-  - Checkboxes now have a wrapping element and an SVG in the DOM for checked and indeterminate states. Radios and switches do not.
+  - Checkboxes apply the `.check` class directly on the `<input>` (no wrapping element) and draw the checked and indeterminate marks with a CSS `mask-image` on a `::before` pseudo-element tinted with the contrast color—no inline SVG in the DOM. Radios and switches are likewise styled without a wrapping element.
   - Revamped layout for checks, radios, and switches with labels (and descriptions). We now have custom elements for layout that include basic flexbox styling.
   - Refactored toggle buttons to use a nested input structure. The `.btn-check` class now goes on the label (not the input), with the input nested inside. This eliminates the need for `id`/`for` attributes and uses CSS `:has()` selector instead of sibling selectors. Example: `<label class="btn-check btn-solid theme-primary"><input type="checkbox">Toggle</label>`.
 - **Consolidate `.form-select` into `.form-control`.**
index c135cec9f6ecae7cc9c47f09dad9a3effa4b2244..3cf786ae3327a6645452d039d61f1953eb4e23f8 100644 (file)
@@ -4,10 +4,6 @@ import * as htmlparser2 from 'htmlparser2'
 const placeholderRegex = /<Placeholder\s+([^>]+)\/>/g
 const closeButtonRegex = /([ \t]*)<CloseButton\s*([^>]*?)\/>/g
 
-// Close button SVG icon
-const CLOSE_BUTTON_SVG_PATH =
-  'M12 0a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4zm-.646 4.646a.5.5 0 0 0-.707 0L8 7.293 5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.647a.5.5 0 1 0 .708.707L8 8.707l2.647 2.646a.5.5 0 1 0 .707-.707L8.707 8l2.646-2.646a.5.5 0 0 0 0-.708z'
-
 /**
  * Generates all the placeholder attributes and options required to render a placeholder.
  * @see src/components/shortcodes/Placeholder.astro
@@ -64,19 +60,13 @@ export function getPlaceholder(userOptions: Partial<PlaceholderOptions>): Placeh
  * Renders a CloseButton component to its HTML string representation.
  * Supports optional `dismiss` and `class` attributes.
  */
-function renderCloseButtonToString(attributes: Record<string, string>, indent = ''): string {
+function renderCloseButtonToString(attributes: Record<string, string>): string {
   const dismiss = attributes.dismiss
   const extraClass = attributes.class
   const dismissAttr = dismiss ? ` data-bs-dismiss="${dismiss}"` : ''
   const classValue = extraClass ? `btn-close ${extraClass}` : 'btn-close'
 
-  return [
-    `<button type="button" class="${classValue}"${dismissAttr} aria-label="Close">`,
-    `${indent}  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="none">`,
-    `${indent}    <path fill="currentcolor" d="${CLOSE_BUTTON_SVG_PATH}"/>`,
-    `${indent}  </svg>`,
-    `${indent}</button>`
-  ].join('\n')
+  return `<button type="button" class="${classValue}"${dismissAttr} aria-label="Close"></button>`
 }
 
 /**
@@ -113,7 +103,7 @@ export function replacePlaceholdersInHtml(html: string) {
       throw new Error('Invalid CloseButton element.')
     }
 
-    return indent + renderCloseButtonToString(closeButtonElement.attribs as Record<string, string>, indent)
+    return indent + renderCloseButtonToString(closeButtonElement.attribs as Record<string, string>)
   })
 
   // Replace Placeholder components
index f4091550b571ec4c0f77666b25be5906774b9343..017c3eb6cd2475355dddc99fedb81c5dbdf95018 100644 (file)
@@ -7,6 +7,17 @@
   --shell-prompt-color: #565c64;
 }
 
+// Geist Mono enables contextual ligatures/alternates (e.g. `--`, `->`, `==`)
+// which distort code. Render glyphs literally for code and inline code.
+code,
+kbd,
+samp,
+pre,
+.astro-code {
+  font-feature-settings: "liga" 0, "calt" 0;
+  font-variant-ligatures: none;
+}
+
 .astro-code {
   --bs-font-monospace: "Geist Mono";