From 20137859d8d93c3cf512b698a2953d159cbfebac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Fri, 24 Jun 2022 11:16:48 +0200 Subject: [PATCH 1/3] add scaffold for link and button style to help engineers with editor style bleed --- themes/10up-theme/assets/css/frontend/base/button.css | 11 +++++++++++ themes/10up-theme/assets/css/frontend/base/index.css | 2 ++ themes/10up-theme/assets/css/frontend/base/link.css | 11 +++++++++++ 3 files changed, 24 insertions(+) create mode 100644 themes/10up-theme/assets/css/frontend/base/button.css create mode 100644 themes/10up-theme/assets/css/frontend/base/link.css diff --git a/themes/10up-theme/assets/css/frontend/base/button.css b/themes/10up-theme/assets/css/frontend/base/button.css new file mode 100644 index 00000000..f40a9ec0 --- /dev/null +++ b/themes/10up-theme/assets/css/frontend/base/button.css @@ -0,0 +1,11 @@ +/* + * Ensure that we are not overriding the editor styles of the + * WordPress Components. + * + * This is a workarround for: https://github.com/WordPress/gutenberg/issues/10178 + * + * using :where to prevent the specificity increase of using :not + */ +button:where(:not(.components-button)) { + +} diff --git a/themes/10up-theme/assets/css/frontend/base/index.css b/themes/10up-theme/assets/css/frontend/base/index.css index ff7075ba..dbb1b5ce 100755 --- a/themes/10up-theme/assets/css/frontend/base/index.css +++ b/themes/10up-theme/assets/css/frontend/base/index.css @@ -1,3 +1,5 @@ @import url("prefers-reduced-motion.css"); @import url("wordpress.css"); @import url("utils.css"); +@import url("button.css"); +@import url("link.css"); diff --git a/themes/10up-theme/assets/css/frontend/base/link.css b/themes/10up-theme/assets/css/frontend/base/link.css new file mode 100644 index 00000000..8c2d4c54 --- /dev/null +++ b/themes/10up-theme/assets/css/frontend/base/link.css @@ -0,0 +1,11 @@ +/* + * Ensure that we are not overriding the editor styles of the + * WordPress Components. + * + * This is a workarround for: https://github.com/WordPress/gutenberg/issues/10178 + * + * using :where to prevent the specificity increase of using :not + */ +a:where(:not(.components-button)) { + +} From b1c2962d916ed2aca4a36047dfb1b4d57315da96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Fri, 24 Jun 2022 11:33:16 +0200 Subject: [PATCH 2/3] fix use correct core selector for link --- themes/10up-theme/assets/css/frontend/base/link.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/10up-theme/assets/css/frontend/base/link.css b/themes/10up-theme/assets/css/frontend/base/link.css index 8c2d4c54..a4362d12 100644 --- a/themes/10up-theme/assets/css/frontend/base/link.css +++ b/themes/10up-theme/assets/css/frontend/base/link.css @@ -6,6 +6,6 @@ * * using :where to prevent the specificity increase of using :not */ -a:where(:not(.components-button)) { +a:where(:not(.components-external-link)) { } From eb44bc2c37122158f2e6fd71eca7718ccff1f902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Fri, 24 Jun 2022 11:34:48 +0200 Subject: [PATCH 3/3] fix typo in code comment --- themes/10up-theme/assets/css/frontend/base/button.css | 2 +- themes/10up-theme/assets/css/frontend/base/link.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/10up-theme/assets/css/frontend/base/button.css b/themes/10up-theme/assets/css/frontend/base/button.css index f40a9ec0..e8d0d868 100644 --- a/themes/10up-theme/assets/css/frontend/base/button.css +++ b/themes/10up-theme/assets/css/frontend/base/button.css @@ -2,7 +2,7 @@ * Ensure that we are not overriding the editor styles of the * WordPress Components. * - * This is a workarround for: https://github.com/WordPress/gutenberg/issues/10178 + * This is a workaround for: https://github.com/WordPress/gutenberg/issues/10178 * * using :where to prevent the specificity increase of using :not */ diff --git a/themes/10up-theme/assets/css/frontend/base/link.css b/themes/10up-theme/assets/css/frontend/base/link.css index a4362d12..a7b4b3d1 100644 --- a/themes/10up-theme/assets/css/frontend/base/link.css +++ b/themes/10up-theme/assets/css/frontend/base/link.css @@ -2,7 +2,7 @@ * Ensure that we are not overriding the editor styles of the * WordPress Components. * - * This is a workarround for: https://github.com/WordPress/gutenberg/issues/10178 + * This is a workaround for: https://github.com/WordPress/gutenberg/issues/10178 * * using :where to prevent the specificity increase of using :not */