Use Sass to scale browser extension styling with variables, nesting, and SCSS modules while keeping a single build workflow. Extension.js supportsDocumentation Index
Fetch the complete documentation index at: https://extension.js.org/llms.txt
Use this file to discover all available pages before exploring further.
.scss and .sass, plus SCSS module variants (.module.scss, .module.sass) through the Rspack-based style pipeline.
When Sass is a good fit
- Your design system already relies on Sass variables and mixins.
- You need modular styles for component-driven extension UIs.
- You want parity with existing Sass workflows in web applications.
Template examples
new-sass

Usage with an existing extension
Add Sass to an existing extension with the steps below.Installation
Install the required dependencies:Example usage in an HTML file
In extension pages (popup/options/new tab), import Sass from your entry script:Sass modules
Scope styles locally with Sass modules, just like CSS modules. Use.module.scss or .module.sass to activate scoping and prevent naming conflicts in your stylesheets.
content-sass-modules

Using Sass modules in an existing extension
To enable Sass modules, rename your Sass file to include.module.scss or .module.sass. This automatically scopes the styles to your component.
Example usage
After renaming your Sass file, import it into your script:React/Preact example usage
Import the Sass module into your React or Preact component, and use the scoped class names:Vue example usage
In Vue SFCs, prefer module styles withlang="scss":
Svelte example usage
In Svelte, import Sass module mappings and apply classes:Behavior notes
- In extension pages,
.module.scssand.module.sassexport class maps for JS/TS imports. - In content scripts, Extension.js emits Sass as CSS assets without JavaScript class-name mappings.
- If your project lacks Sass tooling, Extension.js installs the optional dependencies and asks for a restart.
Next steps
- Learn more about CSS modules.
- Ensure stylesheet quality with Stylelint.

