diff --git a/site/content/docs/5.3/utilities/background.md b/site/content/docs/5.3/utilities/background.md index 4607aca599..8fa68109fb 100644 --- a/site/content/docs/5.3/utilities/background.md +++ b/site/content/docs/5.3/utilities/background.md @@ -1,7 +1,7 @@ --- layout: docs title: Background -description: Convey meaning through `background-color` and add decoration with gradients. +description: Convey meaning through `background-color`. group: utilities aliases: - "/docs/utilities/background/" @@ -14,57 +14,57 @@ toc: true ## Background color -Similar to the contextual text color classes, set the background of an element to any contextual class. Background utilities **do set `color`** to ensure contrasts. +Background utilities like `.bg-*` are generated from our original `$theme-colors` Sass map and respond to color modes. -{{< callout info >}} -Background utilities like `.bg-*` that generated from our original `$theme-colors` Sass map don't yet respond to color modes, however, any `.bg-*-subtle` utility will. This will be resolved in v6. -{{< /callout >}} +Similar to the contextual text color classes, set the background of an element to any contextual class. Background utilities **do not set `color`**, so depending on the cases you'll want to use: +* `.text-*` [color utilities]({{< docsref "/utilities/colors" >}}) when the background color remains the same in light and dark mode +* `.text-bg-*` [color & background helper]({{< docsref "/helpers/color-background" >}}) from our [theme colors]({{< docsref "/customize/color-theme#theming" >}}) +* `[data-bs-theme]` [color mode attribute]({{< docsref "/customize/color-modes#example" >}}) when the element using a background utility contains complex sub-elements such as components that need to respond to color modes -{{< callout info >}} -In case you need to write over one of these background, prefer using our [color & background helper]({{< docsref "/helpers/color-background" >}}) when it exists. -{{< /callout >}} +{{< example >}} +{{< colors.inline >}} +{{- range (index $.Site.Data "theme-colors") }} +
.bg-body-tertiary
+{{< /example >}} -Since [Orange brand distinguishes functional colors from supporting colors]({{< docsref "/customize/color-theme#theming" >}}) and Bootstrap doesn't, naming can be somewhat inconsistent. -Bootstrap's `background-color` utilities are supported in Boosted, but will result in our core `.bg-supporting-*` utilities—making `.bg-danger` inconsistent with `.btn-danger` color, for example. -{{< /callout >}} +In Bootstrap, for each `.bg-*` there is a matching `.bg-*-subtle` utility responding to color modes. In Boosted, subtle colors don't exist so these background utilities have exactly the same value and shouldn't be used. Prefer the regular `.bg-*` utilities instead. + +{{< example >}} +{{< colors.inline >}} +{{- range (index $.Site.Data "theme-colors") }} +