diff --git a/scss/_accordion.scss b/scss/_accordion.scss index b306540d7..a7fe07422 100644 --- a/scss/_accordion.scss +++ b/scss/_accordion.scss @@ -4,7 +4,7 @@ .accordion { // scss-docs-start accordion-css-vars - --#{$prefix}accordion-color: #{color-contrast($accordion-bg)}; + --#{$prefix}accordion-color: #{$accordion-color}; --#{$prefix}accordion-bg: #{$accordion-bg}; --#{$prefix}accordion-transition: #{$accordion-transition}; --#{$prefix}accordion-border-color: #{$accordion-border-color}; diff --git a/scss/_close.scss b/scss/_close.scss index a0813de8d..167104c99 100644 --- a/scss/_close.scss +++ b/scss/_close.scss @@ -38,3 +38,11 @@ .btn-close-white { filter: $btn-close-white-filter; } + +@if $enable-dark-mode { + [data-theme="dark"] { + .btn-close { + filter: $btn-close-white-filter; + } + } +} diff --git a/scss/_root.scss b/scss/_root.scss index b17b1c140..f7f57f4a8 100644 --- a/scss/_root.scss +++ b/scss/_root.scss @@ -88,23 +88,28 @@ --#{$prefix}border-radius-pill: #{$border-radius-pill}; // scss-docs-end root-border-var + --#{$prefix}emphasis-color: #{$emphasis-color}; + --#{$prefix}accent-color: #{$accent-color}; + --#{$prefix}accent-bg: #{$accent-bg}; + --#{$prefix}accent-border: #{$accent-border}; + // TODO: move to form components? or make global? --#{$prefix}form-control-bg: var(--#{$prefix}body-bg); --#{$prefix}form-control-disabled-bg: var(--#{$prefix}secondary-bg); } [data-theme="dark"] { - --#{$prefix}primary: #{$blue-300}; - --#{$prefix}success: #{$green-300}; - --#{$prefix}danger: #{$red-300}; - --#{$prefix}warning: #{$yellow-300}; - --#{$prefix}info: #{$cyan-300}; + // --#{$prefix}primary: #{$blue-300}; + // --#{$prefix}success: #{$green-300}; + // --#{$prefix}danger: #{$red-300}; + // --#{$prefix}warning: #{$yellow-300}; + // --#{$prefix}info: #{$cyan-300}; - --#{$prefix}primary-rgb: #{to-rgb($blue-300)}; - --#{$prefix}success-rgb: #{to-rgb($green-300)}; - --#{$prefix}danger-rgb: #{to-rgb($red-300)}; - --#{$prefix}warning-rgb: #{to-rgb($yellow-300)}; - --#{$prefix}info-rgb: #{to-rgb($cyan-300)}; + // --#{$prefix}primary-rgb: #{to-rgb($blue-300)}; + // --#{$prefix}success-rgb: #{to-rgb($green-300)}; + // --#{$prefix}danger-rgb: #{to-rgb($red-300)}; + // --#{$prefix}warning-rgb: #{to-rgb($yellow-300)}; + // --#{$prefix}info-rgb: #{to-rgb($cyan-300)}; --#{$prefix}body-color: #{$body-color-dark}; --#{$prefix}body-color-rgb: #{to-rgb($body-color-dark)}; @@ -121,6 +126,11 @@ --#{$prefix}tertiary-bg: #{$body-tertiary-bg-dark}; --#{$prefix}tertiary-bg-rgb: #{to-rgb($body-tertiary-bg-dark)}; + --#{$prefix}emphasis-color: #{$emphasis-color-dark}; + --#{$prefix}accent-color: #{$accent-color-dark}; + --#{$prefix}accent-bg: #{$accent-bg-dark}; + --#{$prefix}accent-border: #{$accent-border-dark}; + --#{$prefix}heading-color: #{$headings-color-dark}; --#{$prefix}link-color: #{$link-color-dark}; diff --git a/scss/_variables-dark.scss b/scss/_variables-dark.scss new file mode 100644 index 000000000..54cddee92 --- /dev/null +++ b/scss/_variables-dark.scss @@ -0,0 +1,25 @@ +// Dark color mode variables +// +// Custom variables for the `[data-theme="dark"]` theme. Use this as a starting point for your own custom color modes by creating a new theme-specific file like `_variables-dark.scss` and adding the variables you need. + +$body-color-dark: $gray-500 !default; +$body-bg-dark: $gray-900 !default; +$body-secondary-color-dark: rgba($body-color-dark, .75) !default; +$body-secondary-bg-dark: $gray-800 !default; +$body-tertiary-color-dark: rgba($body-color-dark, .5) !default; +$body-tertiary-bg-dark: mix($gray-800, $gray-900, 50%) !default; +$emphasis-color-dark: $white !default; +$accent-bg-dark: $blue-300 !default; +$accent-color-dark: color-contrast($accent-bg-dark) !default; +$accent-border-dark: $blue-400 !default; +$border-color-dark: $gray-700 !default; +$headings-color-dark: #fff !default; +$link-color-dark: $blue-300 !default; +$link-hover-color-dark: $blue-200 !default; +$code-color-dark: $pink-300 !default; + +$form-select-indicator-color-dark: $body-color-dark !default; +$form-select-indicator-dark: url("data:image/svg+xml,") !default; + +$form-switch-color-dark: rgba($white, .25) !default; +$form-switch-bg-image-dark: url("data:image/svg+xml,") !default; diff --git a/scss/_variables.scss b/scss/_variables.scss index b6c59000e..4d0628357 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -350,6 +350,7 @@ $enable-validation-icons: true !default; $enable-negative-margins: false !default; $enable-deprecation-messages: true !default; $enable-important-utilities: true !default; +$enable-dark-mode: true !default; // Prefix for :root CSS variables @@ -402,20 +403,17 @@ $body-text-align: null !default; $body-color: $gray-900 !default; $body-bg: $white !default; -$body-color-dark: $gray-500 !default; -$body-bg-dark: $gray-900 !default; - $body-secondary-color: rgba($body-color, .75) !default; $body-secondary-bg: $gray-200 !default; $body-tertiary-color: rgba($body-color, .5) !default; $body-tertiary-bg: $gray-100 !default; -$body-secondary-color-dark: rgba($body-color-dark, .75) !default; -$body-secondary-bg-dark: $gray-800 !default; +$emphasis-color: $black !default; -$body-tertiary-color-dark: rgba($body-color-dark, .5) !default; -$body-tertiary-bg-dark: mix($gray-800, $gray-900, 50%) !default; +$accent-bg: $blue !default; +$accent-color: color-contrast($accent-bg) !default; +$accent-border: $blue-500 !default; // Links // @@ -430,9 +428,6 @@ $link-hover-decoration: null !default; $stretched-link-pseudo-element: after !default; $stretched-link-z-index: 1 !default; -$link-color-dark: $blue-300 !default; -$link-hover-color-dark: $blue-200 !default; - // Paragraphs // // Style p element. @@ -504,8 +499,7 @@ $border-widths: ( 5: 5px ) !default; $border-style: solid !default; -$border-color: rgba($black, .15) !default; -$border-color-dark: rgba($white, .15) !default; +$border-color: $gray-300 !default; // scss-docs-end border-variables // scss-docs-start border-radius-variables @@ -609,7 +603,6 @@ $headings-font-style: null !default; $headings-font-weight: 500 !default; $headings-line-height: 1.2 !default; $headings-color: null !default; -$headings-color-dark: #fff !default; // scss-docs-end headings-variables // scss-docs-start display-headings @@ -934,7 +927,7 @@ $input-group-addon-padding-y: $input-padding-y !default; $input-group-addon-padding-x: $input-padding-x !default; $input-group-addon-font-weight: $input-font-weight !default; $input-group-addon-color: $input-color !default; -$input-group-addon-bg: $gray-200 !default; +$input-group-addon-bg: var(--#{$prefix}tertiary-bg) !default; $input-group-addon-border-color: $input-border-color !default; // scss-docs-end input-group-variables @@ -949,7 +942,7 @@ $form-select-line-height: $input-line-height !default; $form-select-color: $input-color !default; $form-select-bg: $input-bg !default; $form-select-disabled-color: null !default; -$form-select-disabled-bg: $gray-200 !default; +$form-select-disabled-bg: $input-disabled-bg !default; $form-select-disabled-border-color: $input-disabled-border-color !default; $form-select-bg-position: right $form-select-padding-x center !default; $form-select-bg-size: 16px 12px !default; // In pixels because image dimensions @@ -986,7 +979,7 @@ $form-select-transition: $input-transition !default; $form-range-track-width: 100% !default; $form-range-track-height: .5rem !default; $form-range-track-cursor: pointer !default; -$form-range-track-bg: $gray-300 !default; +$form-range-track-bg: var(--#{$prefix}tertiary-bg) !default; $form-range-track-border-radius: 1rem !default; $form-range-track-box-shadow: $box-shadow-inset !default; @@ -999,14 +992,14 @@ $form-range-thumb-box-shadow: 0 .1rem .25rem rgba($black, .1) !defa $form-range-thumb-focus-box-shadow: 0 0 0 1px $body-bg, $input-focus-box-shadow !default; $form-range-thumb-focus-box-shadow-width: $input-focus-width !default; // For focus box shadow issue in Edge $form-range-thumb-active-bg: tint-color($component-active-bg, 70%) !default; -$form-range-thumb-disabled-bg: $gray-500 !default; +$form-range-thumb-disabled-bg: var(--#{$prefix}secondary-color) !default; $form-range-thumb-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; // scss-docs-end form-range-variables // scss-docs-start form-file-variables $form-file-button-color: $input-color !default; -$form-file-button-bg: $input-group-addon-bg !default; -$form-file-button-hover-bg: shade-color($form-file-button-bg, 5%) !default; +$form-file-button-bg: var(--#{$prefix}tertiary-bg) !default; +$form-file-button-hover-bg: var(--#{$prefix}secondary-bg) !default; // scss-docs-end form-file-variables // scss-docs-start form-floating-variables @@ -1078,19 +1071,19 @@ $nav-link-font-weight: null !default; $nav-link-color: var(--#{$prefix}link-color) !default; $nav-link-hover-color: var(--#{$prefix}link-hover-color) !default; $nav-link-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out !default; -$nav-link-disabled-color: $gray-600 !default; +$nav-link-disabled-color: var(--#{$prefix}secondary-color) !default; -$nav-tabs-border-color: $gray-300 !default; -$nav-tabs-border-width: $border-width !default; -$nav-tabs-border-radius: $border-radius !default; -$nav-tabs-link-hover-border-color: $gray-200 $gray-200 $nav-tabs-border-color !default; -$nav-tabs-link-active-color: $gray-700 !default; -$nav-tabs-link-active-bg: $body-bg !default; -$nav-tabs-link-active-border-color: $gray-300 $gray-300 $nav-tabs-link-active-bg !default; +$nav-tabs-border-color: var(--#{$prefix}border-color) !default; +$nav-tabs-border-width: var(--#{$prefix}border-width) !default; +$nav-tabs-border-radius: var(--#{$prefix}border-radius) !default; +$nav-tabs-link-hover-border-color: var(--#{$prefix}secondary-bg) var(--#{$prefix}secondary-bg) $nav-tabs-border-color !default; +$nav-tabs-link-active-color: var(--#{$prefix}emphasis-color) !default; +$nav-tabs-link-active-bg: var(--#{$prefix}body-bg) !default; +$nav-tabs-link-active-border-color: var(--#{$prefix}border-color) var(--#{$prefix}border-color) $nav-tabs-link-active-bg !default; $nav-pills-border-radius: $border-radius !default; -$nav-pills-link-active-color: $component-active-color !default; -$nav-pills-link-active-bg: $component-active-bg !default; +$nav-pills-link-active-color: var(--#{$prefix}accent-color) !default; +$nav-pills-link-active-bg: var(--#{$prefix}accent-bg) !default; // scss-docs-end nav-variables @@ -1125,10 +1118,10 @@ $navbar-dark-disabled-color: rgba($white, .25) !default; $navbar-dark-toggler-icon-bg: url("data:image/svg+xml,") !default; $navbar-dark-toggler-border-color: rgba($white, .1) !default; -$navbar-light-color: rgba($black, .55) !default; -$navbar-light-hover-color: rgba($black, .7) !default; -$navbar-light-active-color: rgba($black, .9) !default; -$navbar-light-disabled-color: rgba($black, .3) !default; +$navbar-light-color: var(--#{$prefix}secondary-color) !default; +$navbar-light-hover-color: var(--#{$prefix}body-color) !default; +$navbar-light-active-color: var(--#{$prefix}emphasis-color) !default; +$navbar-light-disabled-color: var(--#{$prefix}tertiary-color) !default; $navbar-light-toggler-icon-bg: url("data:image/svg+xml,") !default; $navbar-light-toggler-border-color: rgba($black, .1) !default; @@ -1208,28 +1201,28 @@ $pagination-padding-x-lg: 1.5rem !default; $pagination-font-size: $font-size-base !default; $pagination-color: var(--#{$prefix}link-color) !default; -$pagination-bg: $white !default; -$pagination-border-radius: $border-radius !default; -$pagination-border-width: $border-width !default; +$pagination-bg: var(--#{$prefix}body-bg) !default; +$pagination-border-radius: var(--#{$prefix}border-radius) !default; +$pagination-border-width: var(--#{$prefix}border-width) !default; $pagination-margin-start: calc($pagination-border-width * -1) !default; // stylelint-disable-line function-disallowed-list -$pagination-border-color: $gray-300 !default; +$pagination-border-color: var(--#{$prefix}border-color) !default; $pagination-focus-color: var(--#{$prefix}link-hover-color) !default; -$pagination-focus-bg: $gray-200 !default; +$pagination-focus-bg: var(--#{$prefix}secondary-bg) !default; $pagination-focus-box-shadow: $input-btn-focus-box-shadow !default; $pagination-focus-outline: 0 !default; $pagination-hover-color: var(--#{$prefix}link-hover-color) !default; -$pagination-hover-bg: $gray-200 !default; -$pagination-hover-border-color: $gray-300 !default; +$pagination-hover-bg: var(--#{$prefix}tertiary-bg) !default; +$pagination-hover-border-color: var(--#{$prefix}border-color) !default; // Todo in v6: remove this? -$pagination-active-color: $component-active-color !default; -$pagination-active-bg: $component-active-bg !default; -$pagination-active-border-color: $pagination-active-bg !default; +$pagination-active-color: var(--#{$prefix}accent-color) !default; +$pagination-active-bg: var(--#{$prefix}accent-bg) !default; +$pagination-active-border-color: var(--#{$prefix}accent-bg) !default; -$pagination-disabled-color: $gray-600 !default; -$pagination-disabled-bg: $white !default; -$pagination-disabled-border-color: $gray-300 !default; +$pagination-disabled-color: var(--#{$prefix}secondary-color) !default; +$pagination-disabled-bg: var(--#{$prefix}secondary-bg) !default; +$pagination-disabled-border-color: var(--#{$prefix}border-color) !default; $pagination-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; @@ -1251,18 +1244,18 @@ $placeholder-opacity-min: .2 !default; $card-spacer-y: $spacer !default; $card-spacer-x: $spacer !default; $card-title-spacer-y: $spacer * .5 !default; -$card-border-width: $border-width !default; +$card-border-width: var(--#{$prefix}border-width) !default; $card-border-color: var(--#{$prefix}border-color) !default; -$card-border-radius: $border-radius !default; +$card-border-radius: var(--#{$prefix}border-radius) !default; $card-box-shadow: null !default; $card-inner-border-radius: subtract($card-border-radius, $card-border-width) !default; $card-cap-padding-y: $card-spacer-y * .5 !default; $card-cap-padding-x: $card-spacer-x !default; -$card-cap-bg: rgba($black, .03) !default; +$card-cap-bg: rgba(var(--#{$prefix}body-color-rgb), .03) !default; $card-cap-color: null !default; $card-height: null !default; $card-color: null !default; -$card-bg: $white !default; +$card-bg: var(--#{$prefix}body-bg) !default; $card-img-overlay-padding: $spacer !default; $card-group-margin: $grid-gutter-width * .5 !default; // scss-docs-end card-variables @@ -1273,10 +1266,10 @@ $card-group-margin: $grid-gutter-width * .5 !default; $accordion-padding-y: 1rem !default; $accordion-padding-x: 1.25rem !default; $accordion-color: var(--#{$prefix}body-color) !default; -$accordion-bg: $body-bg !default; -$accordion-border-width: $border-width !default; +$accordion-bg: var(--#{$prefix}body-bg) !default; +$accordion-border-width: var(--#{$prefix}border-width) !default; $accordion-border-color: var(--#{$prefix}border-color) !default; -$accordion-border-radius: $border-radius !default; +$accordion-border-radius: var(--#{$prefix}border-radius) !default; $accordion-inner-border-radius: subtract($accordion-border-radius, $accordion-border-width) !default; $accordion-body-padding-y: $accordion-padding-y !default; @@ -1308,9 +1301,9 @@ $accordion-button-active-icon: url("data:image/svg+xml,}} - + Navbar @@ -75,7 +75,7 @@ Here's an example of all the sub-components included in a responsive light-theme {{< /example >}} -This example uses [background]({{< docsref "/utilities/background" >}}) (`bg-light`) and [spacing]({{< docsref "/utilities/spacing" >}}) (`me-auto`, `mb-2`, `mb-lg-0`, `me-2`) utility classes. +This example uses [background]({{< docsref "/utilities/background" >}}) (`bg-body-tertiary`) and [spacing]({{< docsref "/utilities/spacing" >}}) (`me-auto`, `mb-2`, `mb-lg-0`, `me-2`) utility classes. ### Brand @@ -87,14 +87,14 @@ Add your text within an element with the `.navbar-brand` class. {{< example >}} - + Navbar - + Navbar @@ -106,7 +106,7 @@ Add your text within an element with the `.navbar-brand` class. You can replace the text within the `.navbar-brand` with an ``. {{< example >}} - + @@ -120,7 +120,7 @@ You can replace the text within the `.navbar-brand` with an ``. You can also make use of some additional utilities to add an image and text at the same time. Note the addition of `.d-inline-block` and `.align-text-top` on the ``. {{< example >}} - + @@ -139,7 +139,7 @@ Add the `.active` class on `.nav-link` to indicate the current page. Please note that you should also add the `aria-current` attribute on the active `.nav-link`. {{< example >}} - + Navbar @@ -168,7 +168,7 @@ Please note that you should also add the `aria-current` attribute on the active And because we use classes for our navs, you can avoid the list-based approach entirely if you like. {{< example >}} - + Navbar @@ -189,7 +189,7 @@ And because we use classes for our navs, you can avoid the list-based approach e You can also use dropdowns in your navbar. Dropdown menus require a wrapping element for positioning, so be sure to use separate and nested elements for `.nav-item` and `.nav-link` as shown below. {{< example >}} - + Navbar @@ -227,7 +227,7 @@ You can also use dropdowns in your navbar. Dropdown menus require a wrapping ele Place various form controls and components within a navbar: {{< example >}} - + @@ -240,7 +240,7 @@ Place various form controls and components within a navbar: Immediate child elements of `.navbar` use flex layout and will default to `justify-content: space-between`. Use additional [flex utilities]({{< docsref "/utilities/flex" >}}) as needed to adjust this behavior. {{< example >}} - + Navbar @@ -254,7 +254,7 @@ Immediate child elements of `.navbar` use flex layout and will default to `justi Input groups work, too. If your navbar is an entire form, or mostly a form, you can use the `` element as the container and save some HTML. {{< example >}} - + @ @@ -267,7 +267,7 @@ Input groups work, too. If your navbar is an entire form, or mostly a form, you Various buttons are supported as part of these navbar forms, too. This is also a great reminder that vertical alignment utilities can be used to align different sized elements. {{< example >}} - + Main button Smaller button @@ -280,7 +280,7 @@ Various buttons are supported as part of these navbar forms, too. This is also a Navbars may contain bits of text with the help of `.navbar-text`. This class adjusts vertical alignment and horizontal spacing for strings of text. {{< example >}} - + Navbar text with an inline element @@ -292,7 +292,7 @@ Navbars may contain bits of text with the help of `.navbar-text`. This class adj Mix and match with other components and utilities as needed. {{< example >}} - + Navbar w/ text @@ -385,7 +385,7 @@ Navbar themes are easier than ever thanks to Bootstrap's combination of Sass and - + Navbar @@ -435,7 +435,7 @@ Although it's not required, you can wrap a navbar in a `.container` to center it {{< example >}} - + Navbar @@ -446,7 +446,7 @@ Although it's not required, you can wrap a navbar in a `.container` to center it Use any of the responsive containers to change how wide the content in your navbar is presented. {{< example >}} - + Navbar @@ -460,7 +460,7 @@ Use our [position utilities]({{< docsref "/utilities/position" >}}) to place nav Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the ``) to prevent overlap with other elements. {{< example >}} - + Default @@ -468,7 +468,7 @@ Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow {{< /example >}} {{< example >}} - + Fixed top @@ -476,7 +476,7 @@ Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow {{< /example >}} {{< example >}} - + Fixed bottom @@ -484,7 +484,7 @@ Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow {{< /example >}} {{< example >}} - + Sticky top @@ -492,7 +492,7 @@ Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow {{< /example >}} {{< example >}} - + Sticky bottom @@ -508,7 +508,7 @@ Please note that this behavior comes with a potential drawback of `overflow`—w Here's an example navbar using `.navbar-nav-scroll` with `style="--bs-scroll-height: 100px;"`, with some extra margin utilities for optimum spacing. {{< example >}} - + Navbar scroll @@ -559,7 +559,7 @@ Navbar togglers are left-aligned by default, but should they follow a sibling el With no `.navbar-brand` shown at the smallest breakpoint: {{< example >}} - + @@ -589,7 +589,7 @@ With no `.navbar-brand` shown at the smallest breakpoint: With a brand name shown on the left and toggler on the right: {{< example >}} - + Navbar @@ -619,7 +619,7 @@ With a brand name shown on the left and toggler on the right: With a toggler on the left and brand name on the right: {{< example >}} - + @@ -675,7 +675,7 @@ Transform your expanding and collapsing navbar into an offcanvas drawer with the In the example below, to create an offcanvas navbar that is always collapsed across all breakpoints, omit the `.navbar-expand-*` class entirely. {{< example >}} - + Offcanvas navbar @@ -721,7 +721,7 @@ In the example below, to create an offcanvas navbar that is always collapsed acr To create an offcanvas navbar that expands into a normal navbar at a specific breakpoint like `lg`, use `.navbar-expand-lg`. ```html - + Offcanvas navbar diff --git a/site/content/docs/5.1/components/offcanvas.md b/site/content/docs/5.1/components/offcanvas.md index 0a487b3b6..da65c09ea 100644 --- a/site/content/docs/5.1/components/offcanvas.md +++ b/site/content/docs/5.1/components/offcanvas.md @@ -27,7 +27,7 @@ Offcanvas is a sidebar component that can be toggled via JavaScript to appear fr Below is an offcanvas example that is shown by default (via `.show` on `.offcanvas`). Offcanvas includes support for a header with a close button and an optional body class for some initial `padding`. We suggest that you include offcanvas headers with dismiss actions whenever possible, or provide an explicit dismiss action. -{{< example class="bd-example-offcanvas p-0 bg-light overflow-hidden" >}} +{{< example class="bd-example-offcanvas p-0 bg-body-secondary overflow-hidden" >}} Offcanvas diff --git a/site/content/docs/5.1/components/toasts.md b/site/content/docs/5.1/components/toasts.md index 02fdff2d3..a5dc605aa 100644 --- a/site/content/docs/5.1/components/toasts.md +++ b/site/content/docs/5.1/components/toasts.md @@ -27,7 +27,7 @@ To encourage extensible and predictable toasts, we recommend a header and body. Toasts are as flexible as you need and have very little required markup. At a minimum, we require a single element to contain your "toasted" content and strongly encourage a dismiss button. -{{< example class="bg-light" >}} +{{< example >}} {{< placeholder width="20" height="20" background="#007aff" class="rounded me-2" text="false" title="false" >}} @@ -121,7 +121,7 @@ Toasts are slightly translucent to blend in with what's below them. You can stack toasts by wrapping them in a toast container, which will vertically add some spacing. -{{< example class="bg-light" >}} +{{< example >}} @@ -153,7 +153,7 @@ You can stack toasts by wrapping them in a toast container, which will verticall Customize your toasts by removing sub-components, tweaking them with [utilities]({{< docsref "/utilities/api" >}}), or by adding your own markup. Here we've created a simpler toast by removing the default `.toast-header`, adding a custom hide icon from [Bootstrap Icons]({{< param icons >}}), and using some [flexbox utilities]({{< docsref "/utilities/flex" >}}) to adjust the layout. -{{< example class="bg-light" >}} +{{< example >}} @@ -166,7 +166,7 @@ Customize your toasts by removing sub-components, tweaking them with [utilities] Alternatively, you can also add additional controls and components to toasts. -{{< example class="bg-light" >}} +{{< example >}} Hello, world! This is a toast message. @@ -182,7 +182,7 @@ Alternatively, you can also add additional controls and components to toasts. Building on the above example, you can create different toast color schemes with our [color]({{< docsref "/utilities/colors" >}}) and [background]({{< docsref "/utilities/background" >}}) utilities. Here we've added `.bg-primary` and `.text-white` to the `.toast`, and then added `.btn-close-white` to our close button. For a crisp edge, we remove the default border with `.border-0`. -{{< example class="bg-light" >}} +{{< example >}} @@ -215,7 +215,7 @@ Place toasts with custom CSS as you need them. The top right is often used for n - + @@ -233,7 +233,7 @@ Place toasts with custom CSS as you need them. The top right is often used for n For systems that generate more notifications, consider using a wrapping element so they can easily stack. -{{< example class="bg-dark bd-example-toasts p-0" >}} +{{< example class="bd-example-toasts p-0" >}} @@ -271,7 +271,7 @@ For systems that generate more notifications, consider using a wrapping element You can also get fancy with flexbox utilities to align toasts horizontally and/or vertically. -{{< example class="bg-dark bd-example-toasts d-flex" >}} +{{< example class="bd-example-toasts d-flex" >}} @@ -308,7 +308,7 @@ As the content you're displaying changes, be sure to update the [`delay` timeout When using `autohide: false`, you must add a close button to allow users to dismiss the toast. -{{< example class="bg-light" >}} +{{< example >}} {{< placeholder width="20" height="20" background="#007aff" class="rounded me-2" text="false" title="false" >}} diff --git a/site/content/docs/5.1/customize/color.md b/site/content/docs/5.1/customize/color.md index 7effd74af..e3d895bef 100644 --- a/site/content/docs/5.1/customize/color.md +++ b/site/content/docs/5.1/customize/color.md @@ -6,11 +6,13 @@ group: customize toc: true --- -## Dark mode +## Color modes -Added in v5.3.0 +{{< added-in "5.3.0" >}} -**Bootstrap now supports dark mode!** After upgrading to v5.3.0, you'll be able to implement your own color mode toggler (see below for an example from Bootstrap's docs) and apply the different color modes as you see fit. Color modes can be toggled globally on the `` element, or on specific components and elements, thanks to an easy `data-theme` attribute. +### Dark mode + +**Bootstrap now supports color modes, starting with dark mode!** After upgrading to v5.3.0, you'll be able to implement your own color mode toggler (see below for an example from Bootstrap's docs) and apply the different color modes as you see fit. Color modes can be toggled globally on the `` element, or on specific components and elements, thanks to the `data-theme` attribute. For example, to change the toggle mode of a dropdown menu, add `data-theme="light"` or `data-theme="dark"` to the parent `.dropdown`. Now, no matter the global color mode, these dropdowns will display as intended. @@ -44,11 +46,11 @@ For example, to change the toggle mode of a dropdown menu, add `data-theme="ligh {{< /example >}} -## Custom color modes +### Custom color modes -While the primary use case for color modes is light and dark mode, custom color modes can easily be added. Create your own `data-theme` selector with a custom value as the name of your color mode, then modify the CSS variables as needed. +While the primary use case for color modes is light and dark mode, custom color modes are also possible. Create your own `data-theme` selector with a custom value as the name of your color mode, then modify our CSS variables as needed. -For example, you can create a blue theme with the selector `data-theme="blue"`. +For example, you can create a "blue theme" with the selector `data-theme="blue"`. {{< scss-docs name="custom-color-mode" file="site/assets/scss/_content.scss" >}} @@ -79,16 +81,18 @@ For example, you can create a blue theme with the selector `data-theme="blue"`. ``` -## New theme colors +## Colors -Added in v5.2.0 +### New theme colors -Bootstrap's color palette has continued to expand and become more nuanced in v5.2.0 with the addition of new `secondary` and `tertiary` colors. Our new colors are available through Sass and CSS variables (but not our color maps), with the express goal of making it easier to customize across multiple colors modes like light and dark. +{{< added-in "5.3.0" >}} + +Bootstrap's color palette has continued to expand and become more nuanced in v5.3.0 with the addition of new `secondary` and `tertiary` text and background colors. Our new colors are available through Sass and CSS variables (but not our color maps) with the express goal of making it easier to customize across multiple colors modes like light and dark. Colors ending in `--rgb` provide the `red, green, blue` values for use in `rgb()` and `rgba()` color modes. For example, `rgba(var(--bs-secondary-bg-rgb), .5)`. {{< callout warning>}} -**Heads up!** There's some potentially confusing things regarding new secondary and tertiary colors, and our secondary theme color. +**Heads up!** There's some potentially confusing things regarding new secondary and tertiary colors, and our secondary theme color. Expect this to be ironed out in v6. {{< /callout >}} {{< bs-table "table text-start table-swatches" >}} @@ -105,7 +109,7 @@ Colors ending in `--rgb` provide the `red, green, blue` values for use in `rgb() | **Info —** Theme color used for neutral and informative content. | Info | `--bs-info``--bs-info-rgb` | {{< /bs-table >}} -## Theme colors +### Theme colors We use a subset of all colors to create a smaller color palette for generating color schemes, also available as Sass variables and a Sass map in Bootstrap's `scss/_variables.scss` file. @@ -113,7 +117,7 @@ We use a subset of all colors to create a smaller color palette for generating c {{< theme-colors.inline >}} {{- range (index $.Site.Data "theme-colors") }} - {{ .name | title }} + {{ .name | title }} {{ end -}} {{< /theme-colors.inline >}} @@ -125,7 +129,7 @@ All these colors are available as a Sass map, `$theme-colors`. Check out [our Sass maps and loops docs]({{< docsref "/customize/sass#maps-and-loops" >}}) for how to modify these colors. -## All colors +### All colors All Bootstrap colors are available as Sass variables and a Sass map in `scss/_variables.scss` file. To avoid increased file sizes, we don't create text or background color classes for each of these variables. Instead, we choose a subset of these colors for a [theme palette](#theme-colors).