Skip to content

Commit 36b7925

Browse files
authored
[RadioButton] consolidate se23 styles (#10053)
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes #9960 <!-- link to issue if one exists --> <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? - Consolidate se23 styles ### How to 🎩 - [Storybook](https://5d559397bae39100201eedc1-bfoqxzgpur.chromatic.com/?path=/story/all-components-radiobutton--disabled-radio) - [Prod Storybook](https://storybook.polaris.shopify.com/?path=/story/all-components-radiobutton--default&globals=polarisSummerEditions2023:true) ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 106b2f6 commit 36b7925

File tree

1 file changed

+22
-58
lines changed

1 file changed

+22
-58
lines changed

polaris-react/src/components/RadioButton/RadioButton.scss

Lines changed: 22 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,9 @@
1111
@include visually-hidden;
1212

1313
&:focus-visible + .Backdrop {
14-
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
15-
@include focus-ring($style: 'focused');
16-
17-
#{$se23} & {
18-
/* stylelint-disable-next-line polaris/border/polaris/at-rule-disallowed-list -- se23 radio overrides */
19-
@include no-focus-ring;
20-
outline: var(--p-border-width-2) solid
21-
var(--p-color-border-interactive-focus);
22-
outline-offset: var(--p-space-025);
23-
}
14+
outline: var(--p-border-width-2) solid
15+
var(--p-color-border-interactive-focus);
16+
outline-offset: var(--p-space-025);
2417

2518
&::after {
2619
border-radius: var(--p-border-radius-full);
@@ -37,14 +30,10 @@
3730
border-color: var(--p-color-border-interactive);
3831

3932
&::before {
40-
#{$se23} & {
41-
background-color: var(--p-color-icon-on-color);
42-
transition: opacity var(--p-motion-duration-150)
43-
var(--p-motion-ease-out),
44-
transform var(--p-motion-duration-150) var(--p-motion-ease-out);
45-
}
46-
transition: opacity var(--p-motion-duration-150) var(--p-motion-ease),
47-
transform var(--p-motion-duration-150) var(--p-motion-ease);
33+
background-color: var(--p-color-icon-on-color);
34+
transition: opacity var(--p-motion-duration-150)
35+
var(--p-motion-ease-out),
36+
transform var(--p-motion-duration-150) var(--p-motion-ease-out);
4837
opacity: 1;
4938
transform: translate(-50%, -50%) scale(1);
5039
}
@@ -54,44 +43,32 @@
5443
&:checked:not([disabled]) + .Backdrop {
5544
&,
5645
.ChoiceLabel:hover & {
57-
#{$se23} & {
58-
background-color: var(--p-color-bg-primary);
59-
border-color: var(--p-color-border-input-active-experimental);
60-
}
46+
background-color: var(--p-color-bg-primary);
47+
border-color: var(--p-color-border-input-active-experimental);
6148
}
6249
}
6350

6451
+ .Backdrop {
6552
.ChoiceLabel:hover & {
6653
cursor: pointer;
6754
border-color: var(--p-color-border-input-hover);
68-
#{$se23} & {
69-
background: var(--p-color-bg-input-hover-experimental);
70-
}
55+
background: var(--p-color-bg-input-hover-experimental);
7156
}
7257

7358
.ChoiceLabel:active & {
74-
#{$se23} & {
75-
border-color: var(--p-color-bg-primary);
76-
border-width: var(--p-border-width-2);
77-
}
59+
border-color: var(--p-color-bg-primary);
60+
border-width: var(--p-border-width-2);
7861
}
7962
}
8063

8164
&:disabled + .Backdrop {
8265
&,
8366
.ChoiceLabel:hover & {
84-
border-color: var(--p-color-border-disabled);
8567
cursor: default;
86-
#{$se23} & {
87-
background-color: var(
88-
--p-color-bg-transparent-secondary-disabled-experimental
89-
);
90-
border: none;
91-
// Duplicating this rule due to the specificity of the se23 selector
92-
// in earlier rules blasting it away.
93-
cursor: default;
94-
}
68+
background-color: var(
69+
--p-color-bg-transparent-secondary-disabled-experimental
70+
);
71+
border: none;
9572

9673
&::before {
9774
background-color: var(--p-color-border-disabled);
@@ -102,26 +79,13 @@
10279
&:disabled:checked + .Backdrop::before {
10380
&,
10481
.ChoiceLabel:hover & {
105-
#{$se23} & {
106-
background-color: var(--p-color-icon-on-color);
107-
}
82+
background-color: var(--p-color-icon-on-color);
10883
}
10984
}
11085
}
11186
/* stylelint-enable selector-max-specificity, selector-max-class, selector-max-combinators */
11287

11388
.Backdrop {
114-
#{$se23} & {
115-
border-width: var(--p-border-width-1-experimental);
116-
background-color: var(--p-color-bg-input);
117-
transition: border-color var(--p-motion-duration-100)
118-
var(--p-motion-ease-out);
119-
120-
&::before {
121-
transition: opacity var(--p-motion-duration-100) var(--p-motion-ease-out),
122-
transform var(--p-motion-duration-100) var(--p-motion-ease-out);
123-
}
124-
}
12589
// stylelint-disable-next-line -- Polaris component custom properties
12690
--pc-icon-size-small: 8px;
12791

@@ -137,10 +101,10 @@
137101
display: block;
138102
width: 100%;
139103
height: 100%;
140-
border: var(--p-border-width-2) solid var(--p-color-border-input);
104+
border: var(--p-border-width-1-experimental) solid var(--p-color-border-input);
141105
border-radius: var(--p-border-radius-full);
142-
background-color: var(--p-color-bg);
143-
transition: border-color var(--p-motion-duration-100) var(--p-motion-ease);
106+
background-color: var(--p-color-bg-input);
107+
transition: border-color var(--p-motion-duration-100) var(--p-motion-ease-out);
144108

145109
&::before {
146110
content: '';
@@ -156,8 +120,8 @@
156120
width: var(--pc-icon-size-small);
157121
background-color: var(--p-color-bg-interactive);
158122
border-radius: var(--p-border-radius-full);
159-
transition: opacity var(--p-motion-duration-100) var(--p-motion-ease),
160-
transform var(--p-motion-duration-100) var(--p-motion-ease);
123+
transition: opacity var(--p-motion-duration-100) var(--p-motion-ease-out),
124+
transform var(--p-motion-duration-100) var(--p-motion-ease-out);
161125

162126
@media (forced-colors: active) {
163127
border: var(--p-border-width-5) solid transparent;

0 commit comments

Comments
 (0)