:root {
// Custom variable values only support SassScript inside `#{}`.
@each $color, $value in $colors {
- --bs-#{$color}: #{$value};
+ --#{$variable-prefix}#{$color}: #{$value};
}
@each $color, $value in $theme-colors {
- --bs-#{$color}: #{$value};
+ --#{$variable-prefix}#{$color}: #{$value};
}
// Use `inspect` for lists so that quoted items keep the quotes.
// See https://github.com/sass/sass/issues/2383#issuecomment-336349172
- --bs-font-sans-serif: #{inspect($font-family-sans-serif)};
- --bs-font-monospace: #{inspect($font-family-monospace)};
- --bs-gradient: #{$gradient};
+ --#{$variable-prefix}font-sans-serif: #{inspect($font-family-sans-serif)};
+ --#{$variable-prefix}font-monospace: #{inspect($font-family-monospace)};
+ --#{$variable-prefix}gradient: #{$gradient};
}
//
.table {
- --bs-table-bg: #{$table-bg};
- --bs-table-accent-bg: transparent;
- --bs-table-striped-color: #{$table-striped-color};
- --bs-table-striped-bg: #{$table-striped-bg};
- --bs-table-active-color: #{$table-active-color};
- --bs-table-active-bg: #{$table-active-bg};
- --bs-table-hover-color: #{$table-hover-color};
- --bs-table-hover-bg: #{$table-hover-bg};
+ --#{$variable-prefix}table-bg: #{$table-bg};
+ --#{$variable-prefix}table-accent-bg: transparent;
+ --#{$variable-prefix}table-striped-color: #{$table-striped-color};
+ --#{$variable-prefix}table-striped-bg: #{$table-striped-bg};
+ --#{$variable-prefix}table-active-color: #{$table-active-color};
+ --#{$variable-prefix}table-active-bg: #{$table-active-bg};
+ --#{$variable-prefix}table-hover-color: #{$table-hover-color};
+ --#{$variable-prefix}table-hover-bg: #{$table-hover-bg};
width: 100%;
margin-bottom: $spacer;
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
padding: $table-cell-padding-y $table-cell-padding-x;
- background-color: var(--bs-table-bg);
- background-image: linear-gradient(var(--bs-table-accent-bg), var(--bs-table-accent-bg));
+ background-color: var(--#{$variable-prefix}table-bg);
+ background-image: linear-gradient(var(--#{$variable-prefix}table-accent-bg), var(--#{$variable-prefix}table-accent-bg));
border-bottom-width: $table-border-width;
}
.table-striped {
> tbody > tr:nth-of-type(#{$table-striped-order}) {
- --bs-table-accent-bg: var(--bs-table-striped-bg);
- color: var(--bs-table-striped-color);
+ --#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-striped-bg);
+ color: var(--#{$variable-prefix}table-striped-color);
}
}
// The `.table-active` class can be added to highlight rows or cells
.table-active {
- --bs-table-accent-bg: var(--bs-table-active-bg);
- color: var(--bs-table-active-color);
+ --#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-active-bg);
+ color: var(--#{$variable-prefix}table-active-color);
}
// Hover effect
.table-hover {
> tbody > tr:hover {
- --bs-table-accent-bg: var(--bs-table-hover-bg);
- color: var(--bs-table-hover-color);
+ --#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-hover-bg);
+ color: var(--#{$variable-prefix}table-hover-color);
}
}
"gradient": (
property: background-image,
class: bg,
- values: (gradient: var(--bs-gradient))
+ values: (gradient: var(--#{$variable-prefix}gradient))
),
"white-space": (
property: white-space,
"font-family": (
property: font-family,
class: font,
- values: (monospace: var(--bs-font-monospace))
+ values: (monospace: var(--#{$variable-prefix}font-monospace))
),
"user-select": (
property: user-select,
$enable-deprecation-messages: true !default;
$enable-important-utilities: true !default;
+// Prefix for :root CSS variables
+
+$variable-prefix: bs- !default;
+
// Gradient
//
// The gradient which is added to components if `$enable-gradients` is `true`
$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;
// stylelint-enable value-keyword-case
-$font-family-base: var(--bs-font-sans-serif) !default;
-$font-family-code: var(--bs-font-monospace) !default;
+$font-family-base: var(--#{$variable-prefix}font-sans-serif) !default;
+$font-family-code: var(--#{$variable-prefix}font-monospace) !default;
// $font-size-root effects the value of `rem`, which is used for as well font sizes, paddings and margins
// $font-size-base effects the font size of the body text
&[type="checkbox"] {
@if $enable-gradients {
- background-image: escape-svg($form-check-input-checked-bg-image), var(--bs-gradient);
+ background-image: escape-svg($form-check-input-checked-bg-image), var(--#{$variable-prefix}gradient);
} @else {
background-image: escape-svg($form-check-input-checked-bg-image);
}
&[type="radio"] {
@if $enable-gradients {
- background-image: escape-svg($form-check-radio-checked-bg-image), var(--bs-gradient);
+ background-image: escape-svg($form-check-radio-checked-bg-image), var(--#{$variable-prefix}gradient);
} @else {
background-image: escape-svg($form-check-radio-checked-bg-image);
}
border-color: $form-check-input-indeterminate-border-color;
@if $enable-gradients {
- background-image: escape-svg($form-check-input-indeterminate-bg-image), var(--bs-gradient);
+ background-image: escape-svg($form-check-input-indeterminate-bg-image), var(--#{$variable-prefix}gradient);
} @else {
background-image: escape-svg($form-check-input-indeterminate-bg-image);
}
background-position: $form-switch-checked-bg-position;
@if $enable-gradients {
- background-image: escape-svg($form-switch-checked-bg-image), var(--bs-gradient);
+ background-image: escape-svg($form-switch-checked-bg-image), var(--#{$variable-prefix}gradient);
} @else {
background-image: escape-svg($form-switch-checked-bg-image);
}
.form-file {
- --bs-form-file-height: #{$form-file-height};
+ --#{$variable-prefix}form-file-height: #{$form-file-height};
position: relative;
}
position: relative;
z-index: 2;
width: 100%;
- height: var(--bs-form-file-height);
+ height: var(--#{$variable-prefix}form-file-height);
margin: 0;
opacity: 0;
left: 0;
z-index: 1;
display: flex;
- height: var(--bs-form-file-height);
+ height: var(--#{$variable-prefix}form-file-height);
border-color: $form-file-border-color;
@include border-radius($form-file-border-radius);
@include box-shadow($form-file-box-shadow);
}
.form-file-sm {
- --bs-form-file-height: #{$form-file-height-sm};
+ --#{$variable-prefix}form-file-height: #{$form-file-height-sm};
@include font-size($form-file-font-size-sm);
.form-file-text,
}
.form-file-lg {
- --bs-form-file-height: #{$form-file-height-lg};
+ --#{$variable-prefix}form-file-height: #{$form-file-height-lg};
@include font-size($form-file-font-size-lg);
.form-file-text,
background-color: $color;
@if $enable-gradients {
- background-image: var(--bs-gradient);
+ background-image: var(--#{$variable-prefix}gradient);
}
}
// Generate semantic grid columns with these mixins.
@mixin make-row($gutter: $grid-gutter-width) {
- --bs-gutter-x: #{$gutter};
- --bs-gutter-y: 0;
+ --#{$variable-prefix}gutter-x: #{$gutter};
+ --#{$variable-prefix}gutter-y: 0;
display: flex;
flex-wrap: wrap;
- margin-top: calc(var(--bs-gutter-y) * -1); // stylelint-disable-line function-disallowed-list
- margin-right: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-disallowed-list
- margin-left: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-disallowed-list
+ margin-top: calc(var(--#{$variable-prefix}gutter-y) * -1); // stylelint-disable-line function-disallowed-list
+ margin-right: calc(var(--#{$variable-prefix}gutter-x) / -2); // stylelint-disable-line function-disallowed-list
+ margin-left: calc(var(--#{$variable-prefix}gutter-x) / -2); // stylelint-disable-line function-disallowed-list
}
@mixin make-col-ready($gutter: $grid-gutter-width) {
flex-shrink: 0;
width: 100%;
max-width: 100%; // Prevent `.col-auto`, `.col` (& responsive variants) from breaking out the grid
- padding-right: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
- padding-left: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
- margin-top: var(--bs-gutter-y);
+ padding-right: calc(var(--#{$variable-prefix}gutter-x) / 2); // stylelint-disable-line function-disallowed-list
+ padding-left: calc(var(--#{$variable-prefix}gutter-x) / 2); // stylelint-disable-line function-disallowed-list
+ margin-top: var(--#{$variable-prefix}gutter-y);
}
@mixin make-col($size, $columns: $grid-columns) {
@each $key, $value in $gutters {
.g#{$infix}-#{$key},
.gx#{$infix}-#{$key} {
- --bs-gutter-x: #{$value};
+ --#{$variable-prefix}gutter-x: #{$value};
}
.g#{$infix}-#{$key},
.gy#{$infix}-#{$key} {
- --bs-gutter-y: #{$value};
+ --#{$variable-prefix}gutter-y: #{$value};
}
}
}
$striped-bg: mix($color, $background, percentage($table-striped-bg-factor));
$active-bg: mix($color, $background, percentage($table-active-bg-factor));
- --bs-table-bg: #{$background};
- --bs-table-striped-bg: #{$striped-bg};
- --bs-table-striped-color: #{color-contrast($striped-bg)};
- --bs-table-active-bg: #{$active-bg};
- --bs-table-active-color: #{color-contrast($active-bg)};
- --bs-table-hover-bg: #{$hover-bg};
- --bs-table-hover-color: #{color-contrast($hover-bg)};
+ --#{$variable-prefix}table-bg: #{$background};
+ --#{$variable-prefix}table-striped-bg: #{$striped-bg};
+ --#{$variable-prefix}table-striped-color: #{color-contrast($striped-bg)};
+ --#{$variable-prefix}table-active-bg: #{$active-bg};
+ --#{$variable-prefix}table-active-color: #{color-contrast($active-bg)};
+ --#{$variable-prefix}table-hover-bg: #{$hover-bg};
+ --#{$variable-prefix}table-hover-color: #{color-contrast($hover-bg)};
color: $color;
border-color: mix($color, $background, percentage($table-border-factor));