Skip to content

Commit

Permalink
fix(tables): support simpler table structure
Browse files Browse the repository at this point in the history
Fixes #34184 

Not quite sure about this, but requiring a `tbody` doesn't feel right either…
  • Loading branch information
ffoodd committed Jun 16, 2021
1 parent d62ba93 commit ba5f8bc
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions scss/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
// We use the universal selectors here to simplify the selector (else we would need 6 different selectors).
// Another advantage is that this generates less code and makes the selector less specific making it easier to override.
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
> tr > *,
> thead > tr > *,
> tbody > tr > *,
> tfoot > tr > * {
padding: $table-cell-padding-y $table-cell-padding-x;
background-color: var(--#{$variable-prefix}table-bg);
border-bottom-width: $table-border-width;
Expand Down Expand Up @@ -60,7 +63,10 @@

.table-sm {
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
> tr > *,
> thead > tr > *,
> tbody > tr > *,
> tfoot > tr > * {
padding: $table-cell-padding-y-sm $table-cell-padding-x-sm;
}
}
Expand All @@ -76,7 +82,10 @@
// to the `td`s or `th`s

.table-bordered {
> :not(caption) > * {
> tr,
> thead > tr,
> tbody > tr,
> tfoot > tr {
border-width: $table-border-width 0;

// stylelint-disable-next-line selector-max-universal
Expand All @@ -88,7 +97,10 @@

.table-borderless {
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
> tr > *,
> thead > tr > *,
> tbody > tr > *,
> tfoot > tr > * {
border-bottom-width: 0;
}
}
Expand Down

0 comments on commit ba5f8bc

Please sign in to comment.