2024-07-29 22:04:11 -07:00
|
|
|
@use "sass:color";
|
|
|
|
@use "sass:math";
|
|
|
|
@use "../functions";
|
|
|
|
@use "../variables";
|
|
|
|
|
2020-03-24 15:00:00 +01:00
|
|
|
// scss-docs-start table-variant
|
|
|
|
@mixin table-variant($state, $background) {
|
|
|
|
.table-#{$state} {
|
2024-07-29 22:04:11 -07:00
|
|
|
$color: functions.color-contrast(functions.opaque(variables.$body-bg, $background));
|
|
|
|
$hover-bg: color.mix($color, $background, math.percentage(variables.$table-hover-bg-factor));
|
|
|
|
$striped-bg: color.mix($color, $background, math.percentage(variables.$table-striped-bg-factor));
|
|
|
|
$active-bg: color.mix($color, $background, math.percentage(variables.$table-active-bg-factor));
|
|
|
|
$table-border-color: color.mix($color, $background, math.percentage(variables.$table-border-factor));
|
2020-03-24 15:00:00 +01:00
|
|
|
|
2024-07-29 22:04:11 -07:00
|
|
|
--#{variables.$prefix}table-color: #{$color};
|
|
|
|
--#{variables.$prefix}table-bg: #{$background};
|
|
|
|
--#{variables.$prefix}table-border-color: #{$table-border-color};
|
|
|
|
--#{variables.$prefix}table-striped-bg: #{$striped-bg};
|
|
|
|
--#{variables.$prefix}table-striped-color: #{functions.color-contrast($striped-bg)};
|
|
|
|
--#{variables.$prefix}table-active-bg: #{$active-bg};
|
|
|
|
--#{variables.$prefix}table-active-color: #{functions.color-contrast($active-bg)};
|
|
|
|
--#{variables.$prefix}table-hover-bg: #{$hover-bg};
|
|
|
|
--#{variables.$prefix}table-hover-color: #{functions.color-contrast($hover-bg)};
|
2020-03-24 15:00:00 +01:00
|
|
|
|
2024-07-29 22:04:11 -07:00
|
|
|
color: var(--#{variables.$prefix}table-color);
|
|
|
|
border-color: var(--#{variables.$prefix}table-border-color);
|
2020-03-24 15:00:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// scss-docs-end table-variant
|