From eafc709eda0289512fb738ce49265f360b9513ea Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Fri, 27 May 2022 11:18:41 +0200 Subject: [PATCH 1/5] lower specificity on file block --- packages/block-library/src/file/style.scss | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/block-library/src/file/style.scss b/packages/block-library/src/file/style.scss index 1e9b86588c885a..cd51a8920a2ad1 100644 --- a/packages/block-library/src/file/style.scss +++ b/packages/block-library/src/file/style.scss @@ -10,19 +10,23 @@ text-align: right; } - .wp-block-file__embed { - margin-bottom: 1em; + * + .wp-block-file__button { + margin-left: 0.75em; } +} - .wp-block-file__button { - background: #32373c; - border-radius: 2em; - color: $white; - font-size: 0.8em; - padding: 0.5em 1em; - } +.wp-block-file__embed { + margin-bottom: 1em; +} - a.wp-block-file__button { +.wp-block-file__button { + background: #32373c; + border-radius: 2em; + color: $white; + font-size: 0.8em; + padding: 0.5em 1em; + + &:is(a) { text-decoration: none; &:hover, @@ -35,8 +39,4 @@ text-decoration: none; } } - - * + .wp-block-file__button { - margin-left: 0.75em; - } } From 3970db8516237e69f2d91c8cf2cf48acefd68991 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Fri, 27 May 2022 11:27:12 +0200 Subject: [PATCH 2/5] lower specificity for search block --- packages/block-library/src/search/style.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/search/style.scss b/packages/block-library/src/search/style.scss index da8ca3e866aa83..a8d20ff3bccb5d 100644 --- a/packages/block-library/src/search/style.scss +++ b/packages/block-library/src/search/style.scss @@ -47,7 +47,7 @@ } } -.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper { +:where(.wp-block-search__button-inside) :where(.wp-block-search__inside-wrapper) { padding: 4px; border: 1px solid #949494; @@ -61,7 +61,7 @@ } } - .wp-block-search__button { + :where(.wp-block-search__button) { padding: 0.125em 0.5em; } } From 82705e009bfd035304580288b3c1fc1fd5220eb7 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Fri, 27 May 2022 16:17:55 +0200 Subject: [PATCH 3/5] made selector more readable, fixed specificity of nested element --- packages/block-library/src/search/style.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/search/style.scss b/packages/block-library/src/search/style.scss index a8d20ff3bccb5d..6e130a5f84f137 100644 --- a/packages/block-library/src/search/style.scss +++ b/packages/block-library/src/search/style.scss @@ -47,7 +47,7 @@ } } -:where(.wp-block-search__button-inside) :where(.wp-block-search__inside-wrapper) { +:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) { padding: 4px; border: 1px solid #949494; @@ -61,7 +61,7 @@ } } - :where(.wp-block-search__button) { + .wp-block-search__button { padding: 0.125em 0.5em; } } From d9296d4bf894ad928b8eec5fa3ffebb6d53183bf Mon Sep 17 00:00:00 2001 From: Maggie Date: Thu, 2 Jun 2022 14:27:49 +0100 Subject: [PATCH 4/5] make a comment on the where rule --- packages/block-library/src/search/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/search/style.scss b/packages/block-library/src/search/style.scss index 6e130a5f84f137..d6b54065e41d9e 100644 --- a/packages/block-library/src/search/style.scss +++ b/packages/block-library/src/search/style.scss @@ -47,6 +47,7 @@ } } +// We are lowering the specificity so that the button element can override the rule for the button inside the search block. :where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) { padding: 4px; border: 1px solid #949494; From bfee6d848308b4a2032800a2d67fee802903071b Mon Sep 17 00:00:00 2001 From: Maggie Date: Thu, 2 Jun 2022 14:31:46 +0100 Subject: [PATCH 5/5] add ed another comment --- packages/block-library/src/file/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/file/style.scss b/packages/block-library/src/file/style.scss index cd51a8920a2ad1..bba0f5e165ce77 100644 --- a/packages/block-library/src/file/style.scss +++ b/packages/block-library/src/file/style.scss @@ -19,6 +19,7 @@ margin-bottom: 1em; } +//This needs a low specificity so it won't override the rules from the button element if defined in theme.json. .wp-block-file__button { background: #32373c; border-radius: 2em;