Skip to content

Commit 3df0b25

Browse files
committed
refactor(Table): add missing CSS Variables
1 parent 8788f03 commit 3df0b25

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

scss/_tables.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
//
44

55
.table {
6+
--#{$variable-prefix}table-color: #{$table-color};
67
--#{$variable-prefix}table-bg: #{$table-bg};
8+
--#{$variable-prefix}table-border-color: #{$table-border-color};
79
--#{$variable-prefix}table-striped-color: #{$table-striped-color};
810
--#{$variable-prefix}table-striped-bg: #{$table-striped-bg};
911
--#{$variable-prefix}table-active-color: #{$table-active-color};
@@ -13,9 +15,9 @@
1315

1416
width: 100%;
1517
margin-bottom: $spacer;
16-
color: $table-color;
18+
color: var(--#{$variable-prefix}table-color);
1719
vertical-align: $table-cell-vertical-align;
18-
border-color: $table-border-color;
20+
border-color: var(--#{$variable-prefix}table-border-color);
1921

2022
// Target th & td
2123
// We need the child combinator to prevent styles leaking to nested tables which doesn't have a `.table` class.

scss/themes/dark/_variables.scss

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ $elevation-base-color-dt: 0, 0, 0 !default;
103103
$theme-body-dt: (
104104
"body-bg": $body-bg-dt,
105105
"body-color": $body-color-dt,
106-
"elevation-base-color": $elevation-base-color-dt
106+
"elevation-base-color": $elevation-base-color-dt,
107+
"text-high-emphasis": $high-emphasis-dt,
108+
"text-medium-emphasis": $medium-emphasis-dt,
109+
"text-disabled": $disabled-dt,
107110
) !default;
108111

109112
// Components
@@ -513,6 +516,33 @@ $sidebar-theme-map: (
513516
"sidebar-toggler-hover-bg": $sidebar-toggler-hover-bg-dt
514517
) !default;
515518

519+
$table-color-dt: $body-color-dt !default;
520+
$table-bg-dt: transparent !default;
521+
$table-border-color-dt: $border-color-dt !default;
522+
523+
$table-striped-color-dt: $table-color-dt !default;
524+
$table-striped-bg-factor-dt: .05 !default;
525+
$table-striped-bg-dt: rgba($white, $table-striped-bg-factor-dt) !default;
526+
527+
$table-active-color-dt: $table-color-dt !default;
528+
$table-active-bg-factor-dt: .1 !default;
529+
$table-active-bg-dt: rgba($black, $table-active-bg-factor-dt) !default;
530+
531+
$table-hover-color-dt: $table-color-dt !default;
532+
$table-hover-bg-factor-dt: .075 !default;
533+
$table-hover-bg-dt: rgba($black, $table-hover-bg-factor-dt) !default;
534+
535+
$table-theme-map: (
536+
"table-color": $table-color-dt,
537+
"table-bg": $table-bg-dt,
538+
"table-border-color": $table-border-color-dt,
539+
"table-striped-color": $table-striped-color-dt,
540+
"table-striped-bg": $table-striped-bg-dt,
541+
"table-active-color": $table-active-color-dt,
542+
"table-active-bg": $table-active-bg-dt,
543+
"table-hover-color": $table-hover-color-dt,
544+
"table-hover-bg": $table-hover-bg-dt
545+
) !default;
516546

517547
// Toast
518548

@@ -562,5 +592,6 @@ $theme-map: (
562592
"popover": $popover-theme-map,
563593
"progress": $progress-theme-map,
564594
"sidebar": $sidebar-theme-map,
595+
"table": $table-theme-map,
565596
"toast": $toast-theme-map
566597
) !default;

0 commit comments

Comments
 (0)