diff options
| author | Louis-Maxime Piton <[email protected]> | 2023-04-26 05:32:27 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-25 20:32:27 -0700 |
| commit | 5400415bb54753f49dc69fd2d79da8ed78173b32 (patch) | |
| tree | acf4ce71a3bb44d124ca8eb20fdb1a89396f310a /site/content/docs | |
| parent | 9aab31ec4232e7e927703d9e495ec8eb3d37c831 (diff) | |
| download | bootstrap-5400415bb54753f49dc69fd2d79da8ed78173b32.tar.xz bootstrap-5400415bb54753f49dc69fd2d79da8ed78173b32.zip | |
Table: active `<tr>` fix (#37084)
* Adding the custom cascade to make `.active` work on `:hover` and on `.table-striped`.
* Prevent nesting backgrounds
* Small typo
* .
* Adding some docs
* Match variable syntax
* .
---------
Co-authored-by: Mark Otto <[email protected]>
Diffstat (limited to 'site/content/docs')
| -rw-r--r-- | site/content/docs/5.3/content/tables.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/site/content/docs/5.3/content/tables.md b/site/content/docs/5.3/content/tables.md index ba83b43cd..78d9870c0 100644 --- a/site/content/docs/5.3/content/tables.md +++ b/site/content/docs/5.3/content/tables.md @@ -227,8 +227,8 @@ Highlight a table row or cell by adding a `.table-active` class. For the accented tables ([striped rows](#striped-rows), [striped columns](#striped-columns), [hoverable rows](#hoverable-rows), and [active tables](#active-tables)), we used some techniques to make these effects work for all our [table variants](#variants): - We start by setting the background of a table cell with the `--bs-table-bg` custom property. All table variants then set that custom property to colorize the table cells. This way, we don't get into trouble if semi-transparent colors are used as table backgrounds. -- Then we add an inset box shadow on the table cells with `box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);` to layer on top of any specified `background-color`. Because we use a huge spread and no blur, the color will be monotone. Since `--bs-table-accent-bg` is unset by default, we don't have a default box shadow. -- When either `.table-striped`, `.table-striped-columns`, `.table-hover` or `.table-active` classes are added, the `--bs-table-accent-bg` is set to a semitransparent color to colorize the background. +- Then we add an inset box shadow on the table cells with `box-shadow: inset 0 0 0 9999px var(--#{$prefix}table-bg--state, var(--#{$prefix}table-bg--type, var(--#{$prefix}table-accent-bg)));` to layer on top of any specified `background-color`. It uses custom cascade to override the `box-shadow`, regardless the CSS specificity. Because we use a huge spread and no blur, the color will be monotone. Since `--bs-table-accent-bg` is set to `transparent` by default, we don't have a default box shadow. +- When either `.table-striped`, `.table-striped-columns`, `.table-hover` or `.table-active` classes are added, either `--bs-table-bg--type` or `--bs-table-bg--state` (by default set to `initial`) are set to a semitransparent color (`--bs-table-striped-bg`, `--bs-table-active-bg` or `--bs-table-hover-bg`) to colorize the background and override default `--bs-table-accent-bg`. - For each table variant, we generate a `--bs-table-accent-bg` color with the highest contrast depending on that color. For example, the accent color for `.table-primary` is darker while `.table-dark` has a lighter accent color. - Text and border colors are generated the same way, and their colors are inherited by default. @@ -427,7 +427,7 @@ Border styles, active styles, and table variants are not inherited by nested tab </div> ```html -<table class="table table-striped"> +<table class="table table-striped table-bordered"> <thead> ... </thead> |
