Update styling standards to prioritize SCSS Modules over Emotion - #14280
Open
andrewscfc wants to merge 2 commits into
Open
Update styling standards to prioritize SCSS Modules over Emotion#14280andrewscfc wants to merge 2 commits into
andrewscfc wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Simorgh’s styling standards documentation to reflect the ongoing migration away from Emotion (CSS-in-JS) toward SCSS Modules + CSS custom properties via ThemeProviderSCSSModules, including guidance on tokens, dark UI, Opera Mini fallbacks, and bidirectional styling.
Changes:
- Replaces Emotion-centric guidance with SCSS Modules-first rules for new/modified components.
- Adds guidance/examples for using
@scss/themeTokens, dark UI overrides, and Opera Mini-safe patterns. - Updates bidi and responsive styling guidance to better align with SCSS Modules and tokenised media queries.
Comments suppressed due to low confidence (6)
docs/Coding-Standards/Styles.mdx:165
- This Opera Mini override example uses
theme.$spacings-*/theme.$mediaQueries-*but doesn’t include@use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the@useline to the snippet.
.promoBox {
position: relative;
width: 100%;
// Opera Mini can't reliably lay these boxes out with flex/grid sizing,
docs/Coding-Standards/Styles.mdx:200
- This example uses
theme.$spacings-fullbut doesn’t include@use '@scss/themeTokens' as theme;, so it won’t compile if copied verbatim. Add the@useline to make the snippet self-contained.
.wrapper {
padding-left: #{theme.$spacings-full};
:global([dir='rtl']) & {
padding-left: 0;
docs/Coding-Standards/Styles.mdx:227
- This
gapexample referencestheme.$spacings-fullbut doesn’t include@use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the@useline for completeness.
.list {
display: flex;
flex-direction: column;
gap: #{theme.$spacings-full};
}
docs/Coding-Standards/Styles.mdx:359
- This “❌” media-query example uses
theme.$spacings-*but doesn’t include@use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the@useline so the example remains runnable while still illustrating the hard-coded breakpoint.
.wrapper {
padding: #{theme.$spacings-half};
@media (min-width: 40rem) {
padding: #{theme.$spacings-full};
docs/Coding-Standards/Styles.mdx:213
- This logical-properties example uses
theme.$spacings-fullbut doesn’t show@use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the@useline inside the snippet to keep it self-contained.
.wrapper {
padding-inline-start: #{theme.$spacings-full};
}
docs/Coding-Standards/Styles.mdx:251
- This SCSS example references
theme.$spacings-fullbut doesn’t include@use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the@useline to the snippet.
.wrapper {
padding-inline-start: #{theme.$spacings-full};
}
Comment on lines
+61
to
65
| ```jsx | ||
| // Do not add new Emotion styling | ||
| const styles = { | ||
| wrapper: css({ | ||
| backgroundColor: 'white', |
Comment on lines
+119
to
+123
| .title { | ||
| color: theme.$palette-grey-10; | ||
|
|
||
| const styles = { | ||
| wrapper: css({ | ||
| backgroundColor: 'white', | ||
| border: '1px solid #eee', | ||
| borderRadius: '0.5rem', | ||
| padding: '1rem', | ||
| }), | ||
| title: theme => | ||
| css({ | ||
| color: theme.colours.primary, | ||
| fontSize: '1.25rem', | ||
| }), | ||
| }; | ||
| :global([data-is-dark-ui='true']) & { | ||
| color: theme.$palette-ghost; |
elvinasv
approved these changes
Jul 30, 2026
Louis-Matsika
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates our component standards to reflect the expectation that we should now use SCSS Modules
Useful Links