Skip to content

Update styling standards to prioritize SCSS Modules over Emotion - #14280

Open
andrewscfc wants to merge 2 commits into
latestfrom
update-style-component-standards
Open

Update styling standards to prioritize SCSS Modules over Emotion#14280
andrewscfc wants to merge 2 commits into
latestfrom
update-style-component-standards

Conversation

@andrewscfc

Copy link
Copy Markdown
Contributor

Summary

Updates our component standards to reflect the expectation that we should now use SCSS Modules

Useful Links

Copilot AI review requested due to automatic review settings July 30, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @use line 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-full but doesn’t include @use '@scss/themeTokens' as theme;, so it won’t compile if copied verbatim. Add the @use line 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 gap example references theme.$spacings-full but doesn’t include @use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the @use line 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 @use line 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-full but doesn’t show @use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the @use line 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-full but doesn’t include @use '@scss/themeTokens' as theme;, so it won’t compile if copied. Add the @use line 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants