diff options
author | Mark Otto <markd.otto@gmail.com> | 2021-12-17 08:16:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 08:16:24 +0300 |
commit | f729e4c7d1d92d2888c76db0e2590f7adfb3a16b (patch) | |
tree | c256d52a5b355d1f32117e1e6a2acad7bce9f94e /site | |
parent | 4a66f229ed701d4ed8d6d5b7469984ab11d822f0 (diff) |
Convert alerts to CSS variables (#35401)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'site')
-rw-r--r-- | site/content/docs/5.1/components/alerts.md | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/site/content/docs/5.1/components/alerts.md b/site/content/docs/5.1/components/alerts.md index d54f7b9cee..97a9d4e3f4 100644 --- a/site/content/docs/5.1/components/alerts.md +++ b/site/content/docs/5.1/components/alerts.md @@ -156,19 +156,27 @@ You can see this in action with a live demo: When an alert is dismissed, the element is completely removed from the page structure. If a keyboard user dismisses the alert using the close button, their focus will suddenly be lost and, depending on the browser, reset to the start of the page/document. For this reason, we recommend including additional JavaScript that listens for the `closed.bs.alert` event and programmatically sets `focus()` to the most appropriate location in the page. If you're planning to move focus to a non-interactive element that normally does not receive focus, make sure to add `tabindex="-1"` to the element. {{< /callout >}} -## Sass +## CSS ### Variables +<small class="d-inline-flex px-2 py-1 font-monospace text-muted border rounded-3">Added in v5.2.0</small> + +As part of Bootstrap's evolving CSS variables approach, buttons now use local CSS variables on `.alert` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. + +{{< scss-docs name="alert-css-vars" file="scss/_alert.scss" >}} + +### Sass variables + {{< scss-docs name="alert-variables" file="scss/_variables.scss" >}} -### Variant mixin +### Sass mixin Used in combination with `$theme-colors` to create contextual modifier classes for our alerts. {{< scss-docs name="alert-variant-mixin" file="scss/mixins/_alert.scss" >}} -### Loop +### Sass loop Loop that generates the modifier classes with the `alert-variant()` mixin. |