Skip to content

Commit 2aa9591

Browse files
kyledurandaaronccasanova
authored andcommitted
fix: global selector to be less specific (#9291)
Previous selector had a specificity of (0,2,1) meaning it would be fairly difficult to override. The new value is (0,1,0) [Before](https://polypane.app/css-specificity-calculator/#selector=html%5Bclass*%3D'Polaris-Summer-Editions-2023'%5D%20.Link) [After](https://polypane.app/css-specificity-calculator/#selector=%3Awhere(html%5Bclass*%3D'Polaris-Summer-Editions-2023'%5D)%20.Link) --------- Co-authored-by: Aaron Casanova <32409546+aaronccasanova@users.noreply.github.com>
1 parent 130db3c commit 2aa9591

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

polaris-react/src/styles/_common.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818

1919
@import '../../../node_modules/@shopify/polaris-tokens/dist/scss/media-queries';
2020

21-
$se23: "html[class*='Polaris-Summer-Editions-2023']";
21+
$se23: ":where(html[class*='Polaris-Summer-Editions-2023'])";

polaris-tokens/scripts/toStyleSheet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export async function toStyleSheet(metadata: Metadata) {
7979
}
8080

8181
const styles = `
82-
:where(html){color-scheme:light;${getStaticCustomProperties(metadata)}}
83-
:where(html.Polaris-Summer-Editions-2023){${getStaticCustomPropertiesExperimental(
82+
:root{color-scheme:light;${getStaticCustomProperties(metadata)}}
83+
:root:where(.Polaris-Summer-Editions-2023){${getStaticCustomPropertiesExperimental(
8484
metadata,
8585
)}}
8686
${getKeyframes(metadata.motion)}

0 commit comments

Comments
 (0)