aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2020-04-24 15:38:39 -0700
committerMark Otto <[email protected]>2020-04-26 17:26:04 -0700
commitac58c25dc8b65928ac817b8a2bf7c0e46a58de97 (patch)
tree471d7f657120d5c2e3097d150dbc36cd9ed4200b
parent7ba43e3361ab5f8347b508ce02fbeb85f60cd412 (diff)
downloadbootstrap-ac58c25dc8b65928ac817b8a2bf7c0e46a58de97.tar.xz
bootstrap-ac58c25dc8b65928ac817b8a2bf7c0e46a58de97.zip
Update CSS variables docs
- Rename available vars section to root vars and mention they're globally available - Add new component vars section and link to table docs for WIP example
-rw-r--r--site/content/docs/4.3/customize/css-variables.md10
1 files changed, 8 insertions, 2 deletions
diff --git a/site/content/docs/4.3/customize/css-variables.md b/site/content/docs/4.3/customize/css-variables.md
index 94989c3f1..fecabbf71 100644
--- a/site/content/docs/4.3/customize/css-variables.md
+++ b/site/content/docs/4.3/customize/css-variables.md
@@ -10,9 +10,9 @@ Bootstrap includes around two dozen [CSS custom properties (variables)](https://
**All our custom properties are prefixed with `bs-` to avoid conflicts with third party CSS.**
-## Available variables
+## Root variables
-Here are the variables we include (note that the `:root` is required). They're located in our `_root.scss` file.
+Here are the variables we include (note that the `:root` is required) that can be accessed anywhere Bootstrap's CSS is loaded. They're located in our `_root.scss` file and included in our compiled dist files.
{{< highlight css >}}
{{< root.inline >}}
@@ -28,6 +28,12 @@ Here are the variables we include (note that the `:root` is required). They're l
{{< /root.inline >}}
{{< /highlight >}}
+## Component variables
+
+We're also beginning to make use of custom properties as local variables for various components. By using CSS variables in this way, we can heavily reduce our compiled CSS, ensure that table styles aren't inherited, and allow you to dynamically restyle or extend Bootstrap components without recompiling Sass.
+
+Have a look at our table documentation for some [insight into how we're using CSS variables]({{< docsref "/content/tables#how-do-the-variants-and-accented-tables-work" >}}).
+
## Examples
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.