From 7187e05cb941138c0e191ef0f28a08430d0e5f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Poupard?= Date: Wed, 16 Jun 2021 17:42:18 +0200 Subject: [PATCH 1/3] fix(tables): support simpler table structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #34184 Not quite sure about this, but requiring a `tbody` doesn't feel right either… --- scss/_tables.scss | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scss/_tables.scss b/scss/_tables.scss index 601d86cc9f..6abf53bd1f 100644 --- a/scss/_tables.scss +++ b/scss/_tables.scss @@ -25,7 +25,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(--#{$prefix}table-bg); border-bottom-width: $table-border-width; @@ -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; } } @@ -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 @@ -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; } From f50ab21f011561e87d7a725c308b24c4c0fc6536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Poupard?= Date: Wed, 16 Jun 2021 17:47:42 +0200 Subject: [PATCH 2/3] styles(tables): drop unused stylelint-disable --- scss/_tables.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/scss/_tables.scss b/scss/_tables.scss index 6abf53bd1f..ae6510f402 100644 --- a/scss/_tables.scss +++ b/scss/_tables.scss @@ -24,7 +24,6 @@ // 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). // 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 > *, > thead > tr > *, > tbody > tr > *, @@ -62,7 +61,6 @@ // .table-sm { - // stylelint-disable-next-line selector-max-universal > tr > *, > thead > tr > *, > tbody > tr > *, @@ -96,7 +94,6 @@ } .table-borderless { - // stylelint-disable-next-line selector-max-universal > tr > *, > thead > tr > *, > tbody > tr > *, From 87239efb59e9d677b243579669e1b2f7c06bc98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Poupard?= Date: Wed, 16 Jun 2021 17:49:36 +0200 Subject: [PATCH 3/3] styles(tables): forgotten stylelint-disable --- scss/_tables.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/scss/_tables.scss b/scss/_tables.scss index ae6510f402..5b0c750f0c 100644 --- a/scss/_tables.scss +++ b/scss/_tables.scss @@ -86,7 +86,6 @@ > tfoot > tr { border-width: $table-border-width 0; - // stylelint-disable-next-line selector-max-universal > * { border-width: 0 $table-border-width; }