From 26963e52b80805358408532dd3d2d975edf551f0 Mon Sep 17 00:00:00 2001 From: Ramon Date: Wed, 21 May 2025 14:44:28 +1000 Subject: [PATCH 1/6] Ensure that existing font-weight styles do not override block and global label styles. --- .../forms/src/blocks/contact-form/editor.scss | 17 ++++++------ .../forms/src/contact-form/css/grunion.css | 26 +++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/projects/packages/forms/src/blocks/contact-form/editor.scss b/projects/packages/forms/src/blocks/contact-form/editor.scss index e8918c0fc38c..a9d6fa48c8f0 100644 --- a/projects/packages/forms/src/blocks/contact-form/editor.scss +++ b/projects/packages/forms/src/blocks/contact-form/editor.scss @@ -418,7 +418,7 @@ &[type="radio"]::before { border-radius: 50%; - transform: translateY(15%); + transform: translateY(0.15rem); } } @@ -446,15 +446,12 @@ .jetpack-option__type::before { display: block; /* display: flex causes baselines to not align */ + transform: translateY(0.15rem); } } - .jetpack-field-option.field-option-radio, - .wp-block-jetpack-field-option-radio { - - .jetpack-option__type { - transform: translateY(5%); /* Small offset to compensate the slightly odd perceived alignment that's due to the circular shape */ - } + .rich-text { + transform: translateY(-0.1rem); } } @@ -813,7 +810,7 @@ transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); margin: 0; - :where( label, .jetpack-field-label__suffix ) { + .jetpack-field-label__suffix { font-weight: 300; } } @@ -1065,6 +1062,10 @@ font-weight: 700; } +:where(.is-style-outlined .wp-block-jetpack-label) { + font-weight: 300; +} + .jetpack-field-dropdown__toggle .rich-text { flex-grow: 1; } diff --git a/projects/packages/forms/src/contact-form/css/grunion.css b/projects/packages/forms/src/contact-form/css/grunion.css index 5beb1b82ce8a..e7e3b0376113 100644 --- a/projects/packages/forms/src/contact-form/css/grunion.css +++ b/projects/packages/forms/src/contact-form/css/grunion.css @@ -84,12 +84,20 @@ display: block; } -.contact-form :where(legend.grunion-field-label), -.contact-form :where(label) { +:where(.contact-form legend.grunion-field-label), +:where(.contact-form label) { margin-bottom: 0.25em; font-weight: 700; } +:where( .grunion-checkbox-multiple-options legend ), +:where( .grunion-radio-options legend ) { + margin-bottom: 0.25em; + padding: 0; + font-weight: 700; +} + + .contact-form :where(label.consent) { font-size: 13px; font-weight: 400; @@ -144,16 +152,6 @@ border: solid 1px var( --jetpack--contact-form--border-color ); } -.grunion-checkbox-multiple-options, -.grunion-radio-options { - - :where( legend ) { - margin-bottom: 0.25em; - padding: 0; - font-weight: 700; - } -} - .contact-form .is-style-animated .grunion-checkbox-multiple-options legend, .contact-form .is-style-animated .grunion-radio-options legend, .contact-form .is-style-outlined .grunion-checkbox-multiple-options legend, @@ -574,10 +572,10 @@ on production builds, the attributes are being reordered, causing side-effects will-change: transform; transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); margin: 0; - font-weight: 300; } -.contact-form .is-style-outlined .grunion-field-wrap legend.grunion-field-label { +:where(.contact-form .is-style-outlined .grunion-field-wrap .notched-label .notched-label__label), +:where(.contact-form .is-style-outlined .grunion-field-wrap legend.grunion-field-label) { font-weight: 300; } From 2124d778756ef82f22972c50e215485780d641de Mon Sep 17 00:00:00 2001 From: Ramon Date: Wed, 21 May 2025 15:26:00 +1000 Subject: [PATCH 2/6] Consent weights --- .../packages/forms/src/blocks/contact-form/editor.scss | 7 ++++--- projects/packages/forms/src/contact-form/css/grunion.css | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/packages/forms/src/blocks/contact-form/editor.scss b/projects/packages/forms/src/blocks/contact-form/editor.scss index a9d6fa48c8f0..530856c7d068 100644 --- a/projects/packages/forms/src/blocks/contact-form/editor.scss +++ b/projects/packages/forms/src/blocks/contact-form/editor.scss @@ -609,10 +609,11 @@ .jetpack-field-checkbox, .jetpack-field-consent { display: flex; +} - .jetpack-field-label .jetpack-field-label__input { - font-weight: 400; - } +.jetpack-field-consent, +.jetpack-field-checkbox .jetpack-field-label .jetpack-field-label__input { + font-weight: 400; } .jetpack-field-checkbox { diff --git a/projects/packages/forms/src/contact-form/css/grunion.css b/projects/packages/forms/src/contact-form/css/grunion.css index e7e3b0376113..38b27149c942 100644 --- a/projects/packages/forms/src/contact-form/css/grunion.css +++ b/projects/packages/forms/src/contact-form/css/grunion.css @@ -98,7 +98,7 @@ } -.contact-form :where(label.consent) { +:where(.contact-form label.consent) { font-size: 13px; font-weight: 400; text-transform: uppercase; From 742cd8ca4a6f330976b2fe6523bb9ca8d03c2be2 Mon Sep 17 00:00:00 2001 From: Ramon Date: Wed, 21 May 2025 17:08:00 +1000 Subject: [PATCH 3/6] Revert options positioning kram --- .../forms/src/blocks/contact-form/editor.scss | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/packages/forms/src/blocks/contact-form/editor.scss b/projects/packages/forms/src/blocks/contact-form/editor.scss index 530856c7d068..afe2488dff1c 100644 --- a/projects/packages/forms/src/blocks/contact-form/editor.scss +++ b/projects/packages/forms/src/blocks/contact-form/editor.scss @@ -418,7 +418,7 @@ &[type="radio"]::before { border-radius: 50%; - transform: translateY(0.15rem); + transform: translateY(15%); } } @@ -446,12 +446,15 @@ .jetpack-option__type::before { display: block; /* display: flex causes baselines to not align */ - transform: translateY(0.15rem); } } - .rich-text { - transform: translateY(-0.1rem); + .jetpack-field-option.field-option-radio, + .wp-block-jetpack-field-option-radio { + + .jetpack-option__type { + transform: translateY(5%); /* Small offset to compensate the slightly odd perceived alignment that's due to the circular shape */ + } } } From 0791de872986ef27120f82d68a4b545f439ef7ce Mon Sep 17 00:00:00 2001 From: Ramon Date: Thu, 22 May 2025 11:58:40 +1000 Subject: [PATCH 4/6] Increase specificity to 0 1 0 for classic themes --- projects/packages/forms/src/contact-form/css/grunion.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/packages/forms/src/contact-form/css/grunion.css b/projects/packages/forms/src/contact-form/css/grunion.css index 38b27149c942..01c3a0c19d3b 100644 --- a/projects/packages/forms/src/contact-form/css/grunion.css +++ b/projects/packages/forms/src/contact-form/css/grunion.css @@ -84,8 +84,8 @@ display: block; } -:where(.contact-form legend.grunion-field-label), -:where(.contact-form label) { +.contact-form :where(legend.grunion-field-label), +.contact-form :where(label) { margin-bottom: 0.25em; font-weight: 700; } From c875ed7a4978b00910e554b87c7c5a990d829df3 Mon Sep 17 00:00:00 2001 From: Ramon Date: Thu, 22 May 2025 15:46:02 +1000 Subject: [PATCH 5/6] Bump specificity of consent label --- projects/packages/forms/src/contact-form/css/grunion.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/packages/forms/src/contact-form/css/grunion.css b/projects/packages/forms/src/contact-form/css/grunion.css index 01c3a0c19d3b..1ff1a91a3821 100644 --- a/projects/packages/forms/src/contact-form/css/grunion.css +++ b/projects/packages/forms/src/contact-form/css/grunion.css @@ -98,7 +98,7 @@ } -:where(.contact-form label.consent) { +.contact-form :where(label.consent) { font-size: 13px; font-weight: 400; text-transform: uppercase; From ff31c061d7b8f6a6e14dbeba23ee98d433e89e43 Mon Sep 17 00:00:00 2001 From: Ramon Date: Fri, 23 May 2025 14:31:45 +1000 Subject: [PATCH 6/6] Bump specificity --- .../packages/forms/src/blocks/contact-form/editor.scss | 8 ++------ projects/packages/forms/src/contact-form/css/grunion.css | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/projects/packages/forms/src/blocks/contact-form/editor.scss b/projects/packages/forms/src/blocks/contact-form/editor.scss index afe2488dff1c..279ca5fa3a95 100644 --- a/projects/packages/forms/src/blocks/contact-form/editor.scss +++ b/projects/packages/forms/src/blocks/contact-form/editor.scss @@ -614,11 +614,6 @@ display: flex; } -.jetpack-field-consent, -.jetpack-field-checkbox .jetpack-field-label .jetpack-field-label__input { - font-weight: 400; -} - .jetpack-field-checkbox { align-items: baseline; @@ -628,6 +623,7 @@ } .jetpack-field-consent { + font-weight: 400; :where(.wp-block-jetpack-option) { font-size: 13px; @@ -1066,7 +1062,7 @@ font-weight: 700; } -:where(.is-style-outlined .wp-block-jetpack-label) { +.is-style-outlined :where(.wp-block-jetpack-label) { font-weight: 300; } diff --git a/projects/packages/forms/src/contact-form/css/grunion.css b/projects/packages/forms/src/contact-form/css/grunion.css index 1ff1a91a3821..59669aa69589 100644 --- a/projects/packages/forms/src/contact-form/css/grunion.css +++ b/projects/packages/forms/src/contact-form/css/grunion.css @@ -90,8 +90,8 @@ font-weight: 700; } -:where( .grunion-checkbox-multiple-options legend ), -:where( .grunion-radio-options legend ) { +.grunion-checkbox-multiple-options :where( legend ), +.grunion-radio-options :where( legend ) { margin-bottom: 0.25em; padding: 0; font-weight: 700; @@ -574,8 +574,8 @@ on production builds, the attributes are being reordered, causing side-effects margin: 0; } -:where(.contact-form .is-style-outlined .grunion-field-wrap .notched-label .notched-label__label), -:where(.contact-form .is-style-outlined .grunion-field-wrap legend.grunion-field-label) { +.contact-form :where(.is-style-outlined .grunion-field-wrap .notched-label .notched-label__label), +.contact-form :where(.is-style-outlined .grunion-field-wrap legend.grunion-field-label) { font-weight: 300; }