UI Styling Standard

The eslint plugin to enforce and educate on Atlassian's UI Styling Standard

The UI Styling Standard is a set of principles to guide styling UI code across Atlassian's frontend codebases and ecosystem.

These are the current ESLint rules that enforce and help comply with the UI Styling Standard today, but more are planned to support the standard over time.

Examples

Check out the migration guide or individual rule documentation for examples.

Rules

RuleDescriptionRecommendedFixableSuggestions
atlaskit-themeBan certain usages of @atlaskit/theme that @compiled/react does not understand
convert-props-syntaxConvert props syntax that is unsupported by styled-components@<4 or @emotion/styled to props syntax that is supported. This is useful when used in conjunction with no-styled-tagged-template-expression, as output from the latter may use props syntax unsupported by those libraries.YesYes
enforce-style-propDisallows usage of static styles in the style attribute in componentsYes
local-cx-xcssEnsures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element.Yes
no-array-argumentsPrevents usage of array arguments to style declaration functionsYesYes
no-atlaskit-themeDisallow imports from @atlaskit/themeYes
no-classname-propDisallows usage of the className prop in JSXYes
no-container-queriesPrevents usage of @container query within css stylingYes
no-dynamic-stylesDisallows use of dynamic styles in CSS-in-JS callsYes
no-exported-stylesDisallows exports of css, keyframes, styled and xcssYes
no-global-stylesPrevents global styles through CSS-in-JS or CSS module importsYes
no-important-stylesDisallows important style declarationsYes
no-imported-style-valuesDisallows imports of style valuesYes
no-nested-selectorsPrevents usage of nested selectors within css stylingYes
no-styledDisallows usage of the styled importsYes
no-unsafe-selectorsDisallows use of nested styles in css functions.YesYesYes
no-unsafe-valuesDisallows styles that are difficult/impossible to statically anaylze.Yes
no-unused-cssmap-propertiesDetects unused properties in cssMap style objects that are not exported. Helps maintain clean code by identifying style variants that are defined but never used.Yes
use-compiledEnsures usage of @compiled/react or @atlaskit/css instead of other CSS-in-JS librariesYesYes
@atlaskit/design-system/consistent-css-prop-usageEnsures consistency with css and xcss prop usagesYesYes
@atlaskit/design-system/no-css-tagged-template-expressionDisallows any css tagged template expressions that originate from Emotion, Styled Components or CompiledYesYes
@atlaskit/design-system/no-keyframes-tagged-template-expressionDisallows any keyframe tagged template expressions that originate from Emotion, Styled Components or CompiledYesYes
@atlaskit/design-system/no-styled-tagged-template-expressionDisallows any styled tagged template expressions that originate from Emotion, Styled Components or CompiledYesYes
@atlaskit/design-system/no-empty-styled-expressionForbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX elements).Yes
@atlaskit/design-system/no-invalid-css-mapChecks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking.Yes
@atlaskit/design-system/no-css-map-scopedDisallows usage of the experimental cssMapScoped API from @compiled/react. This API is internal and is not part of the public Compiled CSS-in-JS interface.Yes

Purpose

To enforce scoped encapsulation, type safety, and deterministic behavior in styling code that is present in other programming languages. This is a stepping stone to large performance improvements, reduced visual regressions, and enables testing and maintainability at scale. This approach improves readability and developer productivity via automation with tooling, testing, code migrations, and future advancements like generative AI.

Desired outcomes

  • We can make large visual changes and migrations safely and in a fraction of the time.
  • To have the vast majority of styling code be deterministic, immutable, and bound to its scope, reducing unknown visual and UX regressions.
  • To enable teams to write tooling quicker that's better and more performant to lint, test, and migrate UI code to improve current and future developer productivity and satisfaction.
  • To enable large performance improvements for customers and developers with a zero-runtime styling solution.
  • To reduce the amount of overall custom styling code written while supporting customization without the need for hacks and technical debt.
  • We aim to see a reduction of the “average styles per component”, reducing the effort to build and maintain UIs.

Core principles

We want the styling ecosystem (CSS, CSS-in-JS, and parts of JSX) at Atlassian and the wider ecosystem we support to be as mature as the other code we write, such as TypeScript/JavaScript, Java, Go, etc.

Like other languages, styling code must be:

  • type-safe
  • static and locally analyzable
  • reusable and composable
  • restricted to an encapsulated scope
  • deterministic—with styling known in isolation
  • discoverable and readable without deep knowledge of the CSS spec

As the W3C CSS spec and wider industry grows, having our styling code meet these principles will mean we can programmatically evolve that a better future state.

Style constraints

Following our core principles, we've developed a set of style constraints.

All styles must be:

  • applied with the css or xcss prop
  • declared as objects with the css() or xcss() function
  • declared at the top-most scope of the module
  • declared in the same module that they are used in
  • static, not dynamic

Additionally, styles cannot be:

  • global (outside of a repo-wide reset like the CSS Reset)
  • exported or imported between modules
  • combined using the spread operator
  • declared with nested selectors

These constraints unlock major performance improvements for Compiled, (opens new window) and raise the floor for static analysis — enabling code evolution at scale.

Benefits

The above style constraints provide numerous benefits:

  • Linters can exhaustively lint all declared styles (all styles have an associated element without indirection).

  • All element styles can be statically known, unlocking code transformation at scale through codemods.

  • Styles are typed end-to-end and can be narrowed, enabling safe, explicit and bounded style overrides.

  • Improved runtime performance, especially by eliminating dynamic styles.

  • Allows for effective build-time optimization when using compile time CSS-in-JS libraries such as Compiled, (opens new window).

  • The impacts of style changes can be better understood by developers, preventing regressions and incidents.

Was this page helpful?
We use this feedback to improve our documentation.
© 2026 AtlassianTrademark, (opens new window)Privacy, (opens new window)License