This commit is contained in:
Gaël Poupard 2025-05-02 08:45:32 +00:00 committed by GitHub
commit f1cf319347
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 8 deletions

View File

@ -29,8 +29,10 @@
// We need the child combinator to prevent styles leaking to nested tables which doesn't have a `.table` class. // We need the child combinator to prevent styles leaking to nested tables which doesn't have a `.table` class.
// We use the universal selectors here to simplify the selector (else we would need 6 different selectors). // 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. // 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 > tr > *,
> :not(caption) > * > * { > thead > tr > *,
> tbody > tr > *,
> tfoot > tr > * {
padding: $table-cell-padding-y $table-cell-padding-x; padding: $table-cell-padding-y $table-cell-padding-x;
// Following the precept of cascades: https://codepen.io/miriamsuzanne/full/vYNgodb // Following the precept of cascades: https://codepen.io/miriamsuzanne/full/vYNgodb
color: var(--#{$prefix}table-color-state, var(--#{$prefix}table-color-type, var(--#{$prefix}table-color))); color: var(--#{$prefix}table-color-state, var(--#{$prefix}table-color-type, var(--#{$prefix}table-color)));
@ -66,8 +68,10 @@
// //
.table-sm { .table-sm {
// stylelint-disable-next-line selector-max-universal > tr > *,
> :not(caption) > * > * { > thead > tr > *,
> tbody > tr > *,
> tfoot > tr > * {
padding: $table-cell-padding-y-sm $table-cell-padding-x-sm; padding: $table-cell-padding-y-sm $table-cell-padding-x-sm;
} }
} }
@ -83,10 +87,12 @@
// to the `td`s or `th`s // to the `td`s or `th`s
.table-bordered { .table-bordered {
> :not(caption) > * { > tr,
> thead > tr,
> tbody > tr,
> tfoot > tr {
border-width: $table-border-width 0; border-width: $table-border-width 0;
// stylelint-disable-next-line selector-max-universal
> * { > * {
border-width: 0 $table-border-width; border-width: 0 $table-border-width;
} }
@ -94,8 +100,10 @@
} }
.table-borderless { .table-borderless {
// stylelint-disable-next-line selector-max-universal > tr > *,
> :not(caption) > * > * { > thead > tr > *,
> tbody > tr > *,
> tfoot > tr > * {
border-bottom-width: 0; border-bottom-width: 0;
} }