From b5b1e1532bb1bc26f81f4d55cd87fcd83a3510b3 Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Thu, 30 Jun 2022 14:51:20 +0530 Subject: [PATCH 1/5] add link hover and active states to theme.json --- curator/style.css | 13 ++++++++----- curator/theme.json | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/curator/style.css b/curator/style.css index df89051b4f..3bef8707cd 100644 --- a/curator/style.css +++ b/curator/style.css @@ -41,6 +41,7 @@ body { background: var(--wp--preset--color--foreground); border-color: var(--wp--preset--color--foreground); color: var(--wp--preset--color--background); + text-decoration: none; } .wp-block-button__link.wp-block-button__link:active { color: var(--wp--preset--color--primary); @@ -106,17 +107,19 @@ body { * Link Styles */ +a:not( + .wp-block-search__button, + .wp-block-button__link +) { + text-underline-offset: .1rem; +} + .wp-block-site-title a { padding: .4rem 0; text-decoration: inherit; /* Needed so the link styles will be inherited correctly from theme.json */ text-underline-offset: .1rem; } -a:not( - .wp-block-search__button, - .wp-block-button__link -):hover, - .wp-block-site-title a:hover { text-decoration: underline; } diff --git a/curator/theme.json b/curator/theme.json index 6a211e8a31..22589db85d 100644 --- a/curator/theme.json +++ b/curator/theme.json @@ -554,7 +554,20 @@ "text": "var(--wp--preset--color--primary)" }, "typography": { - "textDecoration": "none" + "textDecoration": "inherit" + }, + ":hover": { + "typography": { + "textDecoration": "underline" + } + }, + ":active": { + "color": { + "background": "var(--wp--preset--color--tertiary)" + }, + "typography": { + "textDecoration": "none" + } } } }, From f35198291618b07a3955a5265fc405e84bc26d11 Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Thu, 30 Jun 2022 16:32:43 +0530 Subject: [PATCH 2/5] update navigation and post link state styles in theme.json --- curator/style.css | 23 +------------ curator/theme.json | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 22 deletions(-) diff --git a/curator/style.css b/curator/style.css index 3bef8707cd..66eb3b1e5e 100644 --- a/curator/style.css +++ b/curator/style.css @@ -120,10 +120,6 @@ a:not( text-underline-offset: .1rem; } -.wp-block-site-title a:hover { - text-decoration: underline; -} - a:not( .wp-block-search__button, .wp-block-button__link @@ -132,11 +128,6 @@ a:not( text-decoration-style: dotted; } -.wp-block-site-title a:active { - text-decoration: none; - background-color: var(--wp--preset--color--tertiary); -} - /* * Navigation and Other Link Styles */ @@ -147,11 +138,6 @@ a:not( :is( .wp-block-pages-list__item .wp-block-pages-list__item__link, - .wp-block-navigation-link__content, - .wp-block-navigation-item__content, - .wp-block-site-title a, - .wp-block-post-navigation-link a, - .wp-block-post-terms a ):hover { text-decoration: underline; } @@ -169,19 +155,12 @@ a:not( } :is( - .wp-block-pages-list__item .wp-block-pages-list__item__link, - .wp-block-navigation-link__content, - .wp-block-navigation-item__content, - .wp-block-site-title a, - .wp-block-post-navigation-link a, - .wp-block-post-terms a + .wp-block-pages-list__item .wp-block-pages-list__item__link ):active { text-decoration: underline; } .wp-block-post-title a:hover { - color: var(--wp--preset--color--primary); - text-decoration-line: underline; text-decoration-thickness: 0.25rem; text-underline-offset: 0.25rem; } diff --git a/curator/theme.json b/curator/theme.json index 22589db85d..0558e1f621 100644 --- a/curator/theme.json +++ b/curator/theme.json @@ -249,6 +249,25 @@ "core/navigation": { "typography": { "fontSize": "var(--wp--preset--font-size--medium)" + }, + "elements": { + "link": { + ":hover": { + "typography": { + "textDecoration": "underline" + } + }, + ":focus": { + "typography": { + "textDecoration": "underline" + } + }, + ":active": { + "typography": { + "textDecoration": "underline" + } + } + } } }, "core/post-terms": { @@ -262,6 +281,21 @@ "fontWeight":"700", "lineHeight": "0.8", "letterSpacing": "-0.03em" + }, + ":hover": { + "typography": { + "textDecoration": "underline" + } + }, + ":focus": { + "typography": { + "textDecoration": "underline" + } + }, + ":active": { + "typography": { + "textDecoration": "underline" + } } } } @@ -313,6 +347,35 @@ }, "typography": { "textDecoration": "none" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--primary)" + }, + "typography": { + "textDecoration": "underline" + } + } + } + } + }, + "core/post-navigation-link": { + "elements": { + "link": { + ":hover": { + "typography": { + "textDecoration": "underline" + } + }, + ":focus": { + "typography": { + "textDecoration": "underline" + } + }, + ":active": { + "typography": { + "textDecoration": "underline" + } } } } @@ -443,6 +506,19 @@ "link":{ "typography":{ "textDecoration": "none" + }, + ":hover": { + "typography": { + "textDecoration": "underline" + } + }, + ":active": { + "color": { + "background": "var(--wp--preset--color--tertiary)" + }, + "typography": { + "textDecoration": "underline" + } } } } @@ -568,6 +644,11 @@ "typography": { "textDecoration": "none" } + }, + ":focus": { + "typography": { + "textDecoration": "underline" + } } } }, From be0f08a66436db6431c8a7bc032459375d1d17cc Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Thu, 7 Jul 2022 16:04:00 +0530 Subject: [PATCH 3/5] fix text decoration issues --- curator/style.css | 1 - curator/theme.json | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/curator/style.css b/curator/style.css index 66eb3b1e5e..7939380fd7 100644 --- a/curator/style.css +++ b/curator/style.css @@ -161,7 +161,6 @@ a:not( } .wp-block-post-title a:hover { - text-decoration-thickness: 0.25rem; text-underline-offset: 0.25rem; } diff --git a/curator/theme.json b/curator/theme.json index 0558e1f621..8a77373a69 100644 --- a/curator/theme.json +++ b/curator/theme.json @@ -346,14 +346,14 @@ "text": "var(--wp--preset--color--foreground)" }, "typography": { - "textDecoration": "none" + "textDecoration": "none 0.25rem" }, ":hover": { "color": { "text": "var(--wp--preset--color--primary)" }, "typography": { - "textDecoration": "underline" + "textDecoration": "underline 0.25rem" } } } @@ -393,6 +393,11 @@ }, "color": { "text": "var(--wp--preset--color--foreground)" + }, + ":hover": { + "typography": { + "textDecoration": "underline" + } } } } From 2b787d7c107d6ba3d9f51211532059fff269269b Mon Sep 17 00:00:00 2001 From: Jeff Ong Date: Mon, 11 Jul 2022 13:03:54 -0400 Subject: [PATCH 4/5] Invert the default link styles+hover state to match the design. --- curator/theme.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/curator/theme.json b/curator/theme.json index 8a77373a69..43ae9ad48d 100644 --- a/curator/theme.json +++ b/curator/theme.json @@ -362,6 +362,9 @@ "core/post-navigation-link": { "elements": { "link": { + "typography": { + "textDecoration": "none" + }, ":hover": { "typography": { "textDecoration": "underline" @@ -635,11 +638,11 @@ "text": "var(--wp--preset--color--primary)" }, "typography": { - "textDecoration": "inherit" + "textDecoration": "underline" }, ":hover": { "typography": { - "textDecoration": "underline" + "textDecoration": "none" } }, ":active": { From e54f76478cfc86cef94d62b1ecf6f7a317569cc1 Mon Sep 17 00:00:00 2001 From: Jeff Ong Date: Mon, 11 Jul 2022 13:07:01 -0400 Subject: [PATCH 5/5] Remove unneeded comments. --- curator/style.css | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/curator/style.css b/curator/style.css index 7939380fd7..8cc67c3d64 100644 --- a/curator/style.css +++ b/curator/style.css @@ -85,20 +85,12 @@ body { text-decoration: underline; } -/* - * Search and File Block button styles. - * Necessary until the following issues are resolved in Gutenberg: - * https://github.com/WordPress/gutenberg/issues/36444 - * https://github.com/WordPress/gutenberg/issues/27760 - */ - - - /* * Search input styles * Needed until this is resolved in Gutenberg: * https://github.com/WordPress/gutenberg/issues/34198 */ + .wp-block-search__input { border-color: var(--wp--preset--color--foreground); }