diff options
author | Macinto5h <mjcamara@protonmail.com> | 2021-03-14 22:07:24 +0300 |
---|---|---|
committer | Mark Otto <otto@github.com> | 2022-02-07 02:59:18 +0300 |
commit | d2986daa120644a20cefb8ebe609d1404aa34796 (patch) | |
tree | a8b4afdb30689722e01eda7ee3ef0834ab009cb4 /scss | |
parent | 43a9216a7fa90e0e427f9217b89d455019f2ad77 (diff) |
Add zebra striping for table columns
Co-Authored-By: Macallan Camara <44030647+Macinto5h@users.noreply.github.com>
Co-Authored-By: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'scss')
-rw-r--r-- | scss/_tables.scss | 9 | ||||
-rw-r--r-- | scss/_variables.scss | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/scss/_tables.scss b/scss/_tables.scss index 30e898b580..2045111043 100644 --- a/scss/_tables.scss +++ b/scss/_tables.scss @@ -103,6 +103,7 @@ // // Default zebra-stripe styles (alternating gray and transparent backgrounds) +// For rows .table-striped { > tbody > tr:nth-of-type(#{$table-striped-order}) > * { --#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-striped-bg); @@ -110,6 +111,14 @@ } } +// For columns +.table-striped-columns { + > :not(caption) > tr > :nth-child(#{$table-striped-columns-order}) { + --#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-striped-bg); + color: var(--#{$variable-prefix}table-striped-color); + } +} + // Active table // // The `.table-active` class can be added to highlight rows or cells diff --git a/scss/_variables.scss b/scss/_variables.scss index 7b128833ff..0485ffe7c5 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -676,6 +676,7 @@ $table-border-width: $border-width !default; $table-border-color: $border-color !default; $table-striped-order: odd !default; +$table-striped-columns-order: even !default; $table-group-separator-color: currentColor !default; |