aboutsummaryrefslogtreecommitdiff
path: root/scss
diff options
context:
space:
mode:
authorMacinto5h <[email protected]>2021-03-14 15:07:24 -0400
committerMark Otto <[email protected]>2022-02-06 15:59:18 -0800
commitd2986daa120644a20cefb8ebe609d1404aa34796 (patch)
treea8b4afdb30689722e01eda7ee3ef0834ab009cb4 /scss
parent43a9216a7fa90e0e427f9217b89d455019f2ad77 (diff)
downloadbootstrap-d2986daa120644a20cefb8ebe609d1404aa34796.tar.xz
bootstrap-d2986daa120644a20cefb8ebe609d1404aa34796.zip
Add zebra striping for table columns
Co-Authored-By: Macallan Camara <[email protected]> Co-Authored-By: XhmikosR <[email protected]>
Diffstat (limited to 'scss')
-rw-r--r--scss/_tables.scss9
-rw-r--r--scss/_variables.scss1
2 files changed, 10 insertions, 0 deletions
diff --git a/scss/_tables.scss b/scss/_tables.scss
index 30e898b58..204511104 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 7b128833f..0485ffe7c 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;