Skip to content

Commit ef36afe

Browse files
CGastrellmatticbot
authored andcommitted
Forms: add radio styles to mimic checkbox (#46392)
* use styled radio with ::before styled approach for unification with checkboxes * changelog * simplify style by using less convoluted approach Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/20461818309 Upstream-Ref: Automattic/jetpack@bba4854
1 parent c4b68e9 commit ef36afe

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This is an alpha version! The changes listed here are not final.
1111

1212
### Changed
1313
- Refactor Feedback_Test.php into 8 focused test classes for better organization and maintainability
14+
- Update radio button styling to use ::before pseudo-element approach for consistency with checkboxes
1415

1516
### Fixed
1617
- Forms: don't allow ::after pseudo element manipulation on Jetpack Forms radio and checkbox input elements

dist/contact-form/css/grunion-rtl.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/contact-form/css/grunion.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/contact-form/css/grunion.scss

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,23 @@ on production builds, the attributes are being reordered, causing side-effects
10511051

10521052
.contact-form .grunion-field-wrap:not(.is-style-plain) input.radio {
10531053
border-radius: 50%;
1054+
1055+
&::before {
1056+
border-radius: 50%;
1057+
content: "";
1058+
1059+
border-width: 1px;
1060+
border-style: solid;
1061+
1062+
width: 1em;
1063+
height: 1em;
1064+
display: block;
1065+
position: absolute;
1066+
top: -1px;
1067+
left: -1px;
1068+
box-sizing: border-box;
1069+
transition: all 0.1s ease-in-out;
1070+
}
10541071
}
10551072

10561073
.contact-form .is-style-list input.consent:checked,
@@ -1096,22 +1113,7 @@ on production builds, the attributes are being reordered, causing side-effects
10961113
}
10971114

10981115
.contact-form .grunion-field-wrap:not(.is-style-plain) input.radio:checked::before {
1099-
background: currentColor;
1100-
border-radius: 50%;
1101-
content: "";
1102-
1103-
/* Inherit the font size from the parent element.
1104-
* This allows the input to scale with the font size
1105-
* set from global styles or from block styles */
1106-
font-size: inherit;
1107-
height: calc(1em / 2);
1108-
width: calc(1em / 2);
1109-
margin-left: 50%;
1110-
margin-top: 50%;
1111-
position: absolute;
1112-
transform: translate(-50%, -50%);
1113-
top: 0;
1114-
left: 0;
1116+
border-width: 0.3em;
11151117
}
11161118

11171119
.contact-form .grunion-field-wrap.grunion-field-checkbox-multiple-wrap.is-style-button-wrap .contact-form-field,

0 commit comments

Comments
 (0)