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
// Modifiers
&.is-bordered
td,
th
border-width: 1px
tr
&:last-child
td,
th
border-bottom-width: 1px
&.is-fullwidth
width: 100%
> tbody
> tr
> td,
> th
border-width: 1px
> tr
&:last-child
> td,
> th
border-bottom-width: 1px
&.is-hoverable
tbody
tr:not(.is-selected)
&:hover
background-color: $table-row-hover-background-color
&.is-striped
tbody
tr:not(.is-selected)
&:hover
background-color: $table-row-hover-background-color
&:nth-child(even)
background-color: $table-striped-row-even-hover-background-color
> tbody
> tr:not(.is-selected)
&:hover
background-color: $table-row-hover-background-color
&.is-striped
> tbody
> tr:not(.is-selected)
&:hover
background-color: $table-row-hover-background-color
&:nth-child(even)
background-color: $table-striped-row-even-hover-background-color
&.is-narrow
td,
th
padding: 0.25em 0.5em
> tbody,
> tr
> td,
> th
padding: 0.25em 0.5em
&.is-striped
tbody
tr:not(.is-selected)
&:nth-child(even)
background-color: $table-striped-row-even-background-color
> tbody
> tr:not(.is-selected)
&:nth-child(even)
background-color: $table-striped-row-even-background-color
.table-container
@extend %block