diff --git a/scss/_dropdown.scss b/scss/_dropdown.scss index ad45b84a9fd1..2c50f36caed9 100644 --- a/scss/_dropdown.scss +++ b/scss/_dropdown.scss @@ -1,3 +1,5 @@ +// stylelint-disable custom-property-empty-line-before + // The dropdown wrapper (`
`) .dropup, .dropend, @@ -20,7 +22,7 @@ --#{$variable-prefix}dropdown-padding: #{$dropdown-padding-y $dropdown-padding-x}; --#{$variable-prefix}dropdown-spacer: #{$dropdown-spacer}; @include rfs($dropdown-font-size, --#{$variable-prefix}dropdown-font-size); - --#{$variable-prefix}dropdown-color: #{$dropdown-color}; // stylelint-disable-line custom-property-empty-line-before + --#{$variable-prefix}dropdown-color: #{$dropdown-color}; --#{$variable-prefix}dropdown-bg: #{$dropdown-bg}; --#{$variable-prefix}dropdown-border-color: #{$dropdown-border-color}; --#{$variable-prefix}dropdown-border-radius: #{$dropdown-border-radius}; @@ -165,6 +167,7 @@ white-space: nowrap; // prevent links from randomly breaking onto new lines background-color: transparent; // For `
' diff --git a/site/assets/scss/_ads.scss b/site/assets/scss/_ads.scss index b9369eb19cfc..cc5634096976 100644 --- a/site/assets/scss/_ads.scss +++ b/site/assets/scss/_ads.scss @@ -14,10 +14,10 @@ @include font-size(.8125rem); line-height: 1.4; text-align: left; - background-color: $gray-100; + background-color: var(--bs-tertiary-bg); a { - color: $gray-800; + color: var(--bs-body-color); text-decoration: none; } @@ -34,5 +34,5 @@ .carbon-poweredby { display: block; margin-top: .75rem; - color: $gray-700 !important; + color: var(--bs-body-color) !important; } diff --git a/site/assets/scss/_buttons.scss b/site/assets/scss/_buttons.scss index 13bd6e48a389..0613ebc9992c 100644 --- a/site/assets/scss/_buttons.scss +++ b/site/assets/scss/_buttons.scss @@ -34,7 +34,7 @@ .btn-bd-light { --bs-btn-color: var(--bs-gray-600); - --bs-btn-border-color: var(--bs-gray-400); + --bs-btn-border-color: var(--bs-border-color); --bs-btn-hover-color: var(--bd-violet); --bs-btn-hover-border-color: var(--bd-violet); --bs-btn-active-color: var(--bd-violet); @@ -43,3 +43,7 @@ --bs-btn-focus-border-color: var(--bd-violet); --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); } + +.btn-bd-lg { + padding: .8rem 2rem; +} diff --git a/site/assets/scss/_callouts.scss b/site/assets/scss/_callouts.scss index 3c3c469b384c..ad589fecb8ec 100644 --- a/site/assets/scss/_callouts.scss +++ b/site/assets/scss/_callouts.scss @@ -13,7 +13,7 @@ margin-bottom: .25rem; } - p:last-child { + > :last-child { margin-bottom: 0; } diff --git a/site/assets/scss/_clipboard-js.scss b/site/assets/scss/_clipboard-js.scss index 756198b0cc84..38ab5afa0828 100644 --- a/site/assets/scss/_clipboard-js.scss +++ b/site/assets/scss/_clipboard-js.scss @@ -24,8 +24,8 @@ display: block; padding: .5em .75em .625em; line-height: 1; - color: $gray-900; - background-color: $gray-100; + color: var(--bs-body-color); + background-color: var(--bs-tertiary-bg); border: 0; @include border-radius(.25rem); diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index 426b82c1c0b3..95e032067a15 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -86,7 +86,7 @@ position: relative; padding: 1rem; margin: 1rem ($bd-gutter-x * -.5) 0; - border: solid $gray-300; + border: solid var(--bs-border-color); border-width: 1px 0 0; @include clearfix(); @@ -317,7 +317,7 @@ .highlight { padding: .75rem ($bd-gutter-x * .5); margin-bottom: 1rem; - background-color: $gray-100; + background-color: var(--bs-tertiary-bg); @include media-breakpoint-up(md) { padding: .75rem 1.5rem; @@ -339,7 +339,7 @@ pre code { @include font-size(inherit); - color: $gray-900; // Effectively the base text color + color: var(--bs-body-color); // Effectively the base text color word-wrap: normal; } } diff --git a/site/assets/scss/_content.scss b/site/assets/scss/_content.scss index 6c193d72850a..d3eba1aa07e3 100644 --- a/site/assets/scss/_content.scss +++ b/site/assets/scss/_content.scss @@ -31,6 +31,8 @@ // Override Bootstrap defaults > .table { + --bs-table-border-color: var(--bs-border-color); + max-width: 100%; margin-bottom: 1.5rem; @include font-size(.875rem); @@ -74,6 +76,11 @@ min-width: 280px; } +.table-swatches { + td:first-child { width: 340px; } + td:nth-child(2) { width: 200px; } +} + .bd-title { @include font-size(3rem); } @@ -83,8 +90,8 @@ font-weight: 300; } -.bd-text-purple-bright { - color: $bd-violet; +.bd-text-violet { + color: var(--bd-violet); } .bd-bg-purple-bright { @@ -94,6 +101,7 @@ .bi { width: 1em; height: 1em; + vertical-align: -.125em; fill: currentColor; } diff --git a/site/assets/scss/_footer.scss b/site/assets/scss/_footer.scss index 87cee6d2bd0d..b66b6222521b 100644 --- a/site/assets/scss/_footer.scss +++ b/site/assets/scss/_footer.scss @@ -4,12 +4,12 @@ .bd-footer { a { - color: $gray-700; + color: var(--bs-body-color); text-decoration: none; &:hover, &:focus { - color: $link-color; + color: var(--bs-primary); text-decoration: underline; } } diff --git a/site/assets/scss/_masthead.scss b/site/assets/scss/_masthead.scss index bbc867583663..e38c7ded1009 100644 --- a/site/assets/scss/_masthead.scss +++ b/site/assets/scss/_masthead.scss @@ -1,16 +1,15 @@ .bd-masthead { padding: 3rem 0; - background: linear-gradient(165deg, tint-color($bd-purple-light, 85%) 50%, $white 50%); + background: linear-gradient(165deg, rgba(var(--bd-violet-rgb), .05) 50%, var(--bs-body-bg) 50%); h1 { @include font-size(4rem); - line-height: 1; } .lead { @include font-size(1rem); font-weight: 400; - color: $gray-700; + color: var(--bs-secondary-color); } .highlight { @@ -24,8 +23,7 @@ } #carbonads { // stylelint-disable-line selector-max-id - margin-right: auto; - margin-left: auto; + margin-inline: auto; } @include media-breakpoint-up(md) { @@ -35,7 +33,7 @@ } } -.masthead-followup { +.bd-masthead-followup { .lead { @include font-size(1rem); } @@ -71,5 +69,6 @@ } .masthead-notice { - background-color: #d2f4ea; + --bg: #{to-rgb($teal)}; + background-color: rgba(var(--bg), .2); } diff --git a/site/assets/scss/_navbar.scss b/site/assets/scss/_navbar.scss index 91ec45944e90..1a570d60d19a 100644 --- a/site/assets/scss/_navbar.scss +++ b/site/assets/scss/_navbar.scss @@ -2,7 +2,13 @@ padding: .75rem 0; background-color: transparent; background-image: linear-gradient(to bottom, rgba(var(--bd-violet-rgb), 1), rgba(var(--bd-violet-rgb), .95)); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15), inset 0 -1px 0 rgba(0, 0, 0, .15); + box-shadow: 0 .5rem 1rem rgba($black, .15), inset 0 -1px 0 rgba($white, .15); + + [data-theme="dark"] & { + backdrop-filter: blur(.25rem); + background-image: linear-gradient(to bottom, rgba(var(--bd-violet-rgb), 1), rgba(var(--bd-violet-rgb), .75)); + box-shadow: 0 .5rem 1rem rgba($black, .15), inset 0 -1px 0 rgba($white, .15); + } .navbar-toggler { padding: 0; @@ -64,17 +70,63 @@ } .dropdown-menu { - --#{$variable-prefix}dropdown-min-width: 12rem; - --#{$variable-prefix}dropdown-link-hover-bg: rgba(var(--bd-violet-rgb), .1); - @include rfs(.875rem, --#{$variable-prefix}dropdown-font-size); + --bs-dropdown-min-width: 12rem; + --bs-dropdown-padding: .25rem; + --bs-dropdown-link-hover-bg: rgba(var(--bd-violet-rgb), .1); + --bs-dropdown-link-active-bg: rgba(var(--bd-violet-rgb), 1); + @include rfs(.875rem, --bs-dropdown-font-size); + @include border-radius(.5rem); box-shadow: $dropdown-box-shadow; + + .current { + font-weight: 600; + + .bi { + display: block !important; // stylelint-disable-line declaration-no-important + } + } + + .dropdown-item { + @include border-radius(.25rem); + + &:active { + .bi { + color: inherit !important; // stylelint-disable-line declaration-no-important + } + } + } } +} + +.bd-theme-toggle { + width: 2rem; + height: 2rem; + cursor: pointer; +} + +.bd-theme-toggle-checkbox { + position: absolute; + z-index: -1; + width: 1px; + height: 1px; + overflow: hidden; + clip: rect(0 0 0 0); + clip-path: inset(100%); + white-space: nowrap; + + ~ .bd-theme-toggle-light { display: none; } + ~ .bd-theme-toggle-dark { display: block; } - .dropdown-item.current { - font-weight: 600; - background-image: escape-svg($dropdown-active-icon); - background-repeat: no-repeat; - background-position: right $dropdown-item-padding-x top .6rem; - background-size: .75rem .75rem; + &:checked { + ~ .bd-theme-toggle-light { display: block; } + ~ .bd-theme-toggle-dark { display: none; } } } + +.bd-theme-toggle-light { + color: var(--bs-warning); +} + +.bd-theme-toggle-dark { + color: var(--bs-navbar-brand-color); +} diff --git a/site/assets/scss/_sidebar.scss b/site/assets/scss/_sidebar.scss index ed76b3ca823f..9baeb0509cdd 100644 --- a/site/assets/scss/_sidebar.scss +++ b/site/assets/scss/_sidebar.scss @@ -11,6 +11,13 @@ margin-left: -.25rem; overflow-y: auto; } + + @include media-breakpoint-down(lg) { + .offcanvas-lg { + border-right-color: var(--bs-border-color); + box-shadow: $box-shadow-lg; + } + } } .bd-links-nav { @@ -35,16 +42,16 @@ .bd-links-link { padding: .1875rem .5rem; margin-top: .125rem; - margin-left: 1rem; - color: rgba($black, .65); + margin-left: 1.125rem; + color: var(--bs-body-color); text-decoration: if($link-decoration == none, null, none); &:hover, &:focus, &.active { - color: rgba($black, .85); + color: var(--bs-heading-color); text-decoration: if($link-hover-decoration == underline, none, null); - background-color: rgba(var(--bd-violet-rgb), .1); + background-color: var(--bd-sidebar-link-bg); } &.active { diff --git a/site/assets/scss/_syntax.scss b/site/assets/scss/_syntax.scss index 19eee4163d24..67a2fb8159b4 100644 --- a/site/assets/scss/_syntax.scss +++ b/site/assets/scss/_syntax.scss @@ -1,88 +1,121 @@ -// stylelint-disable comment-empty-line-before, declaration-block-single-line-max-declarations +:root, +[data-theme="light"] { + --base00: #fff; + --base01: #f5f5f5; + --base02: #c8c8fa; + --base03: #969896; + --base04: #030303; + --base05: #333; + --base06: #fff; + --base07: #b08800; + --base08: #ed6a43; + --base09: #0086b3; + --base0A: #795da3; + --base0B: #183691; + --base0C: #183691; + --base0D: #795da3; + --base0E: #a71d5d; + --base0F: #333; +} + +[data-theme="dark"] { + --base00: #282c34; + --base01: #353b45; + --base02: #3e4451; + --base03: #545862; + --base04: #565c64; + --base05: #abb2bf; + --base06: #b6bdca; + --base07: #d19a66; + --base08: #e06c75; + --base09: #d19a66; + --base0A: #e5c07b; + --base0B: #98c379; + --base0C: #56b6c2; + --base0D: #61afef; + --base0E: #c678dd; + --base0F: #be5046; +} + +.hll { background-color: #fff; } +.c { color: var(--base04); } +.err { color: var(--base08); } +.k { color: var(--base0E); } +.l { color: var(----base09); } +.n { color: var(--base08); } +.o { color: var(--base05); } +.p { color: var(--base05); } +.cm { color: var(--base04); } +.cp { color: var(--base04); } +.c1 { color: var(--base03); } +.cs { color: var(--base04); } +.gd { color: var(--base08); } +.ge { font-style: italic; } +.gh { + font-weight: 600; + color: #fff; +} +.gi { color: var(--base0C); } +.gp { + font-weight: 600; + color: var(--base04); +} +.gs { font-weight: 600; } +.gu { + font-weight: 600; + color: var(--base0C); +} +.kc { color: var(--base0E); } +.kd { color: var(--base0E); } +.kn { color: var(--base0C); } +.kp { color: var(--base0E); } +.kr { color: var(--base0E); } +.kt { color: var(--base0A); } +.ld { color: var(--base0C); } +.m { color: var(--base09); } +.s { color: var(--base0C); } +.na { color: var(--base0A); } +.nb { color: var(--base05); } +.nc { color: var(--base07); } +.no { color: var(--base08); } +.nd { color: var(--base07); } +.ni { color: var(--base08); } +.ne { color: var(--base08); } +.nf { color: var(--base0B); } +.nl { color: var(--base05); } +.nn { color: var(--base0A); } +.nx { color: var(--base0A); } +.py { color: var(--base08); } +.nt { color: var(--base08); } +.nv { color: var(--base08); } +.ow { color: var(--base0C); } +.w { color: #fff; } +.mf { color: var(--base09); } +.mh { color: var(--base09); } +.mi { color: var(--base09); } +.mo { color: var(--base09); } +.sb { color: var(--base0C); } +.sc { color: #fff; } +.sd { color: var(--base04); } +.s2 { color: var(--base0C); } +.se { color: var(--base09); } +.sh { color: var(--base0C); } +.si { color: var(--base09); } +.sx { color: var(--base0C); } +.sr { color: var(--base0C); } +.s1 { color: var(--base0C); } +.ss { color: var(--base0C); } +.bp { color: var(--base05); } +.vc { color: var(--base08); } +.vg { color: var(--base08); } +.vi { color: var(--base08); } +.il { color: var(--base09); } -/* Background .chroma { background-color: #f0f0f0; } */ -/* Other .chroma .x { } */ -/* Error .chroma .err { } */ -/* LineTableTD .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } */ -/* LineTable .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; } */ -/* LineHighlight .chroma .hl { display: block; width: 100%; background-color: #ffffcc; } */ -/* LineNumbersTable .chroma .lnt { margin-right: .4em; padding: 0 .4em; } */ -/* LineNumbers .chroma .ln { margin-right: .4em; padding: 0 .4em; } */ +// Color commas in rgba() values +.m + .o { color: var(--base03); } -/* Comment */ .chroma .c { color: #727272; } -/* CommentHashbang */ .chroma .ch { font-style: italic; color: #60a0b0; } -/* CommentMultiline */ .chroma .cm { color: #727272; } -/* CommentPreproc */ .chroma .cp { color: #008085; } -/* CommentPreprocFile */ .chroma .cpf { color: #007020; } -/* CommentSingle */ .chroma .c1 { color: #727272; } -/* CommentSpecial */ .chroma .cs { color: #727272; } -/* Generic .chroma .g { } */ -/* GenericDeleted */ .chroma .gd { background-color: #fcc; border: 1px solid #c00; } -/* GenericEmph */ .chroma .ge { font-style: italic; } -/* GenericError */ .chroma .gr { color: #f00; } -/* GenericHeading */ .chroma .gh { color: #030; } -/* GenericInserted */ .chroma .gi { background-color: #cfc; border: 1px solid #0c0; } -/* GenericOutput */ .chroma .go { color: #aaa; } -/* GenericPrompt */ .chroma .gp { color: #009; } -/* GenericStrong */ .chroma .gs { font-weight: 700; } -/* GenericSubheading */ .chroma .gu { color: #030; } -/* GenericTraceback */ .chroma .gt { color: #9c6; } -/* GenericUnderline */ .chroma .gl { text-decoration: underline; } -/* Keyword */ .chroma .k { color: #069; } -/* KeywordConstant */ .chroma .kc { color: #069; } -/* KeywordDeclaration */ .chroma .kd { color: #069; } -/* KeywordNamespace */ .chroma .kn { color: #069; } -/* KeywordPseudo */ .chroma .kp { color: #069; } -/* KeywordReserved */ .chroma .kr { color: #069; } -/* KeywordType */ .chroma .kt { color: #078; } -/* Literal .chroma .l { } */ -/* LiteralDate .chroma .ld { color: #c24f19 } */ -/* LiteralNumber */ .chroma .m { color: #c24f19; } -/* LiteralNumberBin */ .chroma .mb { color: #40a070; } -/* LiteralNumberFloat */ .chroma .mf { color: #c24f19; } -/* LiteralNumberHex */ .chroma .mh { color: #c24f19; } -/* LiteralNumberInteger */ .chroma .mi { color: #c24f19; } -/* LiteralNumberIntegerLong */ .chroma .il { color: #c24f19; } -/* LiteralNumberOct */ .chroma .mo { color: #c24f19; } -/* LiteralString */ .chroma .s { color: #d73038; } -/* LiteralStringAffix */ .chroma .sa { color: #4070a0; } -/* LiteralStringBacktick */ .chroma .sb { color: #c30; } -/* LiteralStringChar */ .chroma .sc { color: #c30; } -/* LiteralStringDelimiter */ .chroma .dl { color: #4070a0; } -/* LiteralStringDoc */ .chroma .sd { font-style: italic; color: #c30; } -/* LiteralStringDouble */ .chroma .s2 { color: #c30; } -/* LiteralStringEscape */ .chroma .se { color: #c30; } -/* LiteralStringHeredoc */ .chroma .sh { color: #c30; } -/* LiteralStringInterpol */ .chroma .si { color: #a00; } -/* LiteralStringOther */ .chroma .sx { color: #c30; } -/* LiteralStringRegex */ .chroma .sr { color: #337e7e; } -/* LiteralStringSingle */ .chroma .s1 { color: #c30; } -/* LiteralStringSymbol */ .chroma .ss { color: #fc3; } -/* Name .chroma .n { } */ -/* NameAttribute */ .chroma .na { color: #006ee0; } -/* NameBuiltin */ .chroma .nb { color: #366; } -/* NameBuiltinPseudo .chroma .bp { } */ -/* NameClass */ .chroma .nc { color: #168174; } -/* NameConstant */ .chroma .no { color: #360; } -/* NameDecorator */ .chroma .nd { color: #6b62de; } -/* NameEntity */ .chroma .ni { color: #727272; } -/* NameException */ .chroma .ne { color: #c00; } -/* NameFunction */ .chroma .nf { color: #b715f4; } -/* NameFunctionMagic .chroma .fm { } */ -/* NameLabel */ .chroma .nl { color: #6b62de; } -/* NameNamespace */ .chroma .nn { color: #007ca5; } -/* NameOther .chroma .nx { } */ -/* NameProperty .chroma .py { } */ -/* NameTag */ .chroma .nt { color: #2f6f9f; } -/* NameVariable */ .chroma .nv { color: #033; } -/* NameVariableClass .chroma .vc { } */ -/* NameVariableGlobal .chroma .vg { } */ -/* NameVariableInstance .chroma .vi { } */ -/* NameVariableMagic .chroma .vm { } */ -/* Operator */ .chroma .o { color: #555; } -/* OperatorWord */ .chroma .ow { color: #000; } -/* Punctuation .chroma .p { } */ -/* TextWhitespace */ .chroma .w { color: #bbb; } +// Fix bash +.language-sh .c { color: var(--base03); } .chroma { .language-bash, diff --git a/site/assets/scss/_toc.scss b/site/assets/scss/_toc.scss index 512a11b42029..2132c8f30568 100644 --- a/site/assets/scss/_toc.scss +++ b/site/assets/scss/_toc.scss @@ -52,7 +52,7 @@ } @include media-breakpoint-down(md) { - border: 1px solid $border-color; + border: 1px solid var(--bs-border-color); @include border-radius(.4rem); &:hover, diff --git a/site/assets/scss/_variables.scss b/site/assets/scss/_variables.scss index 8c00d8d4580d..3ae7dfc2ed84 100644 --- a/site/assets/scss/_variables.scss +++ b/site/assets/scss/_variables.scss @@ -5,7 +5,6 @@ $bd-purple: #4c0bce; $bd-violet: lighten(saturate($bd-purple, 5%), 15%); // stylelint-disable-line function-disallowed-list $bd-purple-light: lighten(saturate($bd-purple, 5%), 45%); // stylelint-disable-line function-disallowed-list $bd-accent: #ffe484; -$dropdown-active-icon: url("data:image/svg+xml,"); $bd-gutter-x: 2rem; $bd-callout-variants: info, warning, danger !default; @@ -16,4 +15,11 @@ $bd-callout-variants: info, warning, danger !default; --bd-accent: #{$bd-accent}; --bd-violet-rgb: #{to-rgb($bd-violet)}; --bd-accent-rgb: #{to-rgb($bd-accent)}; + --bd-sidebar-link-bg: rgba(var(--bd-violet-rgb), .1); +} + +@media (prefers-color-scheme: dark) { + :root { + --bd-violet: #{mix($bd-violet, $black, 75%)}; + } } diff --git a/site/content/docs/5.1/components/dropdowns.md b/site/content/docs/5.1/components/dropdowns.md index 4a53be28d29c..782f91761638 100644 --- a/site/content/docs/5.1/components/dropdowns.md +++ b/site/content/docs/5.1/components/dropdowns.md @@ -963,9 +963,13 @@ As part of Bootstrap's evolving CSS variables approach, dropdowns now use local {{< scss-docs name="dropdown-css-vars" file="scss/_dropdown.scss" >}} -Customization through CSS variables can be seen on the `.dropdown-menu-dark` class where we override specific values without adding duplicate CSS selectors. +{{< callout info >}} +Dropdown items include at least one variable that is not set on `.dropdown`. This allows you to provide a new value while Bootstrap defaults to a fallback value. -{{< scss-docs name="dropdown-dark-css-vars" file="scss/_dropdown.scss" >}} +- `--bs-dropdown-item-border-radius` +{{< /callout >}} + +Customization through CSS variables can be seen on the `.dropdown-menu-dark` class where we override specific values without adding duplicate CSS selectors. ### Sass variables diff --git a/site/content/docs/5.1/customize/color.md b/site/content/docs/5.1/customize/color.md index 1b9647645b2f..63e1b33f20f8 100644 --- a/site/content/docs/5.1/customize/color.md +++ b/site/content/docs/5.1/customize/color.md @@ -6,6 +6,70 @@ group: customize toc: true --- +## Dark mode + +Added in v5.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. + +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. + +{{< example class="d-flex justify-content-between" >}} + + + +{{< /example >}} + +## New theme colors + +Added in v5.2.0 + +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. + +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. +{{< /callout >}} + +{{< bs-table "table text-start table-swatches" >}} +| Description | Swatch | Variables | +| --- | --- | --- | +| **Body —** Default foreground (color) and background, including components. |
 
 
| `--bs-body-color`
`--bs-body-color-rgb`
`--bs-body-bg`
`--bs-body-bg-rgb` | +| **Secondary —** For disabled states, dividers, and lighter text. |
 
 
| `--bs-secondary-color`
`--bs-secondary-color-rgb`
`--bs-secondary-bg`
`--bs-secondary-bg-rgb` | +| **Tertiary —** For hovers, accents, wells, and text. |
 
 
| `--bs-tertiary-color`
`--bs-tertiary-color-rgb`
`--bs-tertiary-bg`
`--bs-tertiary-bg-rgb` | +| **Border —** For component borders, dividers, and rules. Blends with background colors thanks to `rgba()` values. |
Border color
| `--bs-border-color` | +| **Primary —** Main theme color, used for hyperlinks, focus styles, and component and form active states. |
Primary
| `--bs-primary`
`--bs-primary-rgb` | +| **Success —** Theme color used for positive or successful actions and information. |
Success
| `--bs-success`
`--bs-success-rgb` | +| **Danger —** Theme color used for errors and dangerous actions. |
Danger
| `--bs-danger`
`--bs-danger-rgb` | +| **Warning —** Theme color used for warning messages. |
Warning
| `--bs-warning`
`--bs-warning-rgb` | +| **Info —** Theme color used for neutral and informative content. |
Info
| `--bs-info`
`--bs-info-rgb` | +{{< /bs-table >}} + ## 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. diff --git a/site/content/docs/5.1/customize/css-variables.md b/site/content/docs/5.1/customize/css-variables.md index 06a4cbdb983c..7efba0ec4867 100644 --- a/site/content/docs/5.1/customize/css-variables.md +++ b/site/content/docs/5.1/customize/css-variables.md @@ -46,7 +46,7 @@ Customize the prefix via the `$variable-prefix` Sass variable. By default, it's CSS variables offer similar flexibility to Sass's variables, but without the need for compilation before being served to the browser. For example, here we're resetting our page's font and link styles with CSS variables. -```css +```scss body { font: 1rem/1.5 var(--bs-font-sans-serif); } diff --git a/site/layouts/_default/baseof.html b/site/layouts/_default/baseof.html index fdf19b31f075..608a6f857ac3 100644 --- a/site/layouts/_default/baseof.html +++ b/site/layouts/_default/baseof.html @@ -1,5 +1,5 @@ - + {{ partial "header" . }} diff --git a/site/layouts/_default/docs.html b/site/layouts/_default/docs.html index 3c61cd342195..ba2f99daaa63 100644 --- a/site/layouts/_default/docs.html +++ b/site/layouts/_default/docs.html @@ -1,5 +1,5 @@ {{ define "main" }} -
+