]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add `bs-` prefixes to custom properties (#30591)
authorMartijn Cuppens <martijn.cuppens@gmail.com>
Wed, 15 Apr 2020 16:52:16 +0000 (18:52 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2020 16:52:16 +0000 (18:52 +0200)
scss/_reboot.scss
scss/_root.scss
scss/_utilities.scss
scss/_variables.scss
scss/mixins/_grid.scss
site/content/docs/4.3/getting-started/theming.md

index e7a1f2a11ebbdaf72fbea674a1f64580f925f936..c6b10d59fef9ba6988e1956f8cb1afbb513b386e 100644 (file)
@@ -283,7 +283,7 @@ pre,
 code,
 kbd,
 samp {
-  font-family: var(--font-family-monospace);
+  font-family: var(--bs-font-monospace);
   @include font-size(1em); // Correct the odd `em` font sizing in all browsers.
 }
 
index 055ac32fb091ce5c6eaeb825dbc462db030afbc2..86f7493c2ad1fc29b17634bbc6b1ce5b4e38b551 100644 (file)
@@ -1,15 +1,15 @@
 :root {
   // Custom variable values only support SassScript inside `#{}`.
   @each $color, $value in $colors {
-    --#{$color}: #{$value};
+    --bs-#{$color}: #{$value};
   }
 
   @each $color, $value in $theme-colors {
-    --#{$color}: #{$value};
+    --bs-#{$color}: #{$value};
   }
 
   // Use `inspect` for lists so that quoted items keep the quotes.
   // See https://github.com/sass/sass/issues/2383#issuecomment-336349172
-  --font-family-sans-serif: #{inspect($font-family-sans-serif)};
-  --font-family-monospace: #{inspect($font-family-monospace)};
+  --bs-font-sans-serif: #{inspect($font-family-sans-serif)};
+  --bs-font-monospace: #{inspect($font-family-monospace)};
 }
index c02eec7b3e466dcc547d07250ddc9527b55deb2e..2d886bc4fe5227e9c987168df9c6642a75067b9a 100644 (file)
@@ -441,7 +441,7 @@ $utilities: map-merge(
     "font-family": (
       property: font-family,
       class: font,
-      values: (monospace: var(--font-family-monospace))
+      values: (monospace: var(--bs-font-monospace))
     ),
     "user-select": (
       property: user-select,
index 04cf98992409c6a52e7a9de3375da904072e2246..419ff183003b767e9dcb76cb708690a0524214f4 100644 (file)
@@ -376,7 +376,7 @@ $embed-responsive-aspect-ratios: (
 // stylelint-disable value-keyword-case
 $font-family-sans-serif:      system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
 $font-family-monospace:       SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default;
-$font-family-base:            var(--font-family-sans-serif) !default;
+$font-family-base:            var(--bs-font-sans-serif) !default;
 // stylelint-enable value-keyword-case
 
 // $font-size-root effects the value of `rem`, which is used for as well font sizes, paddings and margins
index aba7dcb58395b6c51ce3fc6a29bf90e765a1f772..bfc60d88ab1078655832bfc3e8be09277ae29335 100644 (file)
@@ -3,13 +3,13 @@
 // Generate semantic grid columns with these mixins.
 
 @mixin make-row($gutter: $grid-gutter-width) {
-  --grid-gutter-x: #{$gutter};
-  --grid-gutter-y: 0;
+  --bs-gutter-x: #{$gutter};
+  --bs-gutter-y: 0;
   display: flex;
   flex-wrap: wrap;
-  margin-top: calc(var(--grid-gutter-y) * -1); // stylelint-disable-line function-blacklist
-  margin-right: calc(var(--grid-gutter-x) / -2); // stylelint-disable-line function-blacklist
-  margin-left: calc(var(--grid-gutter-x) / -2); // stylelint-disable-line function-blacklist
+  margin-top: calc(var(--bs-gutter-y) * -1); // stylelint-disable-line function-blacklist
+  margin-right: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-blacklist
+  margin-left: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-blacklist
 }
 
 @mixin make-col-ready($gutter: $grid-gutter-width) {
@@ -21,9 +21,9 @@
   flex-shrink: 0;
   width: 100%;
   max-width: 100%; // Prevent `.col-auto`, `.col` (& responsive variants) from breaking out the grid
-  padding-right: calc(var(--grid-gutter-x) / 2); // stylelint-disable-line function-blacklist
-  padding-left: calc(var(--grid-gutter-x) / 2); // stylelint-disable-line function-blacklist
-  margin-top: var(--grid-gutter-y);
+  padding-right: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-blacklist
+  padding-left: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-blacklist
+  margin-top: var(--bs-gutter-y);
 }
 
 @mixin make-col($size, $columns: $grid-columns) {
       @each $key, $value in $gutters {
         .g#{$infix}-#{$key},
         .gx#{$infix}-#{$key} {
-          --grid-gutter-x: #{$value};
+          --bs-gutter-x: #{$value};
         }
 
         .g#{$infix}-#{$key},
         .gy#{$infix}-#{$key} {
-          --grid-gutter-y: #{$value};
+          --bs-gutter-y: #{$value};
         }
       }
     }
index 73d5b0f7804d0a66b0c835a650afc9dec3cd0cfb..71bccebf2c065f7490b660b0179b5dcfb1e672a1 100644 (file)
@@ -399,7 +399,7 @@ Should you need to modify your `$grid-breakpoints`, your changes will apply to a
 
 ## CSS variables
 
-Bootstrap 4 includes around two dozen [CSS custom properties (variables)](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) in its compiled CSS. These provide easy access to commonly used values like our theme colors, breakpoints, and primary font stacks when working in your browser's Inspector, a code sandbox, or general prototyping.
+Bootstrap 4 includes around two dozen [CSS custom properties (variables)](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) in its compiled CSS. These provide easy access to commonly used values like our theme colors and primary font stacks when working in your browser's Inspector, a code sandbox, or general prototyping. All our custom properties are prefixed with `bs-` to avoid conflicts with third party CSS.
 
 ### Available variables
 
@@ -425,9 +425,9 @@ CSS variables offer similar flexibility to Sass's variables, but without the nee
 
 {{< highlight css >}}
 body {
-  font: 1rem/1.5 var(--font-family-sans-serif);
+  font: 1rem/1.5 var(--bs-font-sans-serif);
 }
 a {
-  color: var(--blue);
+  color: var(--bs-blue);
 }
 {{< /highlight >}}