Fix table modifiers for nested table

For nested <table><table></table></table>, when you apply modifier to the parent table, the child table also change behavor.
Before: .table.modifier tbody tr td 
After: .table.modifier > tbody > tr >td
This commit is contained in:
Artem Shevtsov 2022-01-27 17:19:29 +10:00 committed by GitHub
parent c2697bf131
commit 8bae2f5fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,37 +93,40 @@ $table-colors: $colors !default
border-bottom-width: 0 border-bottom-width: 0
// Modifiers // Modifiers
&.is-bordered &.is-bordered
td, > tbody
th > tr
border-width: 1px > td,
tr > th
&:last-child border-width: 1px
td, > tr
th &:last-child
border-bottom-width: 1px > td,
&.is-fullwidth > th
width: 100% border-bottom-width: 1px
&.is-hoverable &.is-hoverable
tbody > tbody
tr:not(.is-selected) > tr:not(.is-selected)
&:hover &:hover
background-color: $table-row-hover-background-color background-color: $table-row-hover-background-color
&.is-striped &.is-striped
tbody > tbody
tr:not(.is-selected) > tr:not(.is-selected)
&:hover &:hover
background-color: $table-row-hover-background-color background-color: $table-row-hover-background-color
&:nth-child(even) &:nth-child(even)
background-color: $table-striped-row-even-hover-background-color background-color: $table-striped-row-even-hover-background-color
&.is-narrow &.is-narrow
td, > tbody,
th > tr
padding: 0.25em 0.5em > td,
> th
padding: 0.25em 0.5em
&.is-striped &.is-striped
tbody > tbody
tr:not(.is-selected) > tr:not(.is-selected)
&:nth-child(even) &:nth-child(even)
background-color: $table-striped-row-even-background-color background-color: $table-striped-row-even-background-color
.table-container .table-container
@extend %block @extend %block