PACKAGE · CSS FRAMEWORK

sass

A pure JavaScript implementation of Sass.

WEEKLY DOWNLOADS 13.1M
STARS 4.2K
FORKS 376
OPEN ISSUES 74
GZIP SIZE 707.5 kB
UNPACKED SIZE 5.9 MB
DEPENDENCIES 2
LAST UPDATED 4mo ago
DOWNLOAD TRENDS

sass downloads — last 12 months

Download trends for sass1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.028.8M57.6M86.4M115.1MJun 2025SepDecMarMay 2026
sass
ABOUT SASS

The `sass` package provides a pure JavaScript implementation of the Sass stylesheet language, enabling developers to write more maintainable and powerful CSS. It addresses the limitations of plain CSS by introducing features like variables, nesting, mixins, and inheritance, which streamline the development process and reduce redundancy in stylesheets. This implementation aims to bring the full power of Sass to any JavaScript environment without requiring external compilers or specific runtime dependencies.

Designed with a focus on developer experience and broad compatibility, the `sass` package is intended for frontend developers and teams looking to enhance their CSS authoring workflow. Its core philosophy revolves around providing a robust and standards-compliant Sass engine that integrates seamlessly into modern JavaScript build tools and frameworks. The goal is to make advanced CSS features accessible and easy to use within a familiar JavaScript ecosystem.

The primary API allows for programmatic compilation of Sass files or strings directly within JavaScript applications. Developers can import Sass files, define Sass variables, and access compilation results, including source maps and warnings, through a structured JavaScript interface. This programmatic access is facilitated by functions like `compileString` and `compile`, enabling dynamic styling or custom build processes.

This package excels at integration with popular build tools and frontend frameworks like Webpack, Rollup, and Vite, often through dedicated plugins or loaders. It fits naturally into CI/CD pipelines and local development workflows, allowing for Sass compilation as part of the asset bundling process. This ensures that CSS output is optimized and ready for production deployment.

With a significant weekly download count of 27.5 million, `sass` demonstrates widespread adoption and maturity. While it is a pure JavaScript implementation, its unpacked size of 5.9 MB and gzipped bundle size of 707.5 kB are important considerations for client-side environments where bundle size is critical. The engine itself is based on Dart Sass, known for its performance and feature set.

While offering extensive functionality, developers should be aware of the JavaScript runtime requirement. Unlike native compilers, this package relies on Node.js or a compatible JavaScript environment for execution. The substantial bundle size may also be a factor in performance-sensitive client-side rendering scenarios where a lighter alternative might be more appropriate.

WHEN TO USE
  • When you need to programmatically compile Sass strings or files within a Node.js or browser JavaScript environment.
  • To leverage Sass features like variables, mixins, and nesting directly in your JavaScript build process.
  • When integrating Sass compilation into custom build scripts or CI/CD pipelines that rely on JavaScript execution.
  • If you require access to Sass compilation results, including source maps and error reports, via a JavaScript API.
  • To maintain a consistent styling language across projects by compiling Sass within your frontend framework's build steps.
  • When developing tools or libraries that need to process or generate Sass code programmatically.
WHEN NOT TO USE
  • If you only require basic CSS without advanced features, plain CSS or a simpler CSS-in-JS solution may suffice.
  • When targeting environments where a large JavaScript bundle size is a critical performance concern and a native compiler is available.
  • If your build process already includes a separate, highly optimized native Sass compiler and you don't need programmatic access from JavaScript.
  • For very simple projects where the overhead of introducing a Sass compiler, even a JavaScript-based one, is not justified.
  • If you need to compile Sass on the client-side in a production environment and minimizing initial load time is paramount, consider pre-compilation.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 8
sass vs @emotion/react ★ 18.0K · 8.7M/wk sass vs tailwindcss ★ 95.4K · 58.5M/wk sass vs styled-components ★ 41.0K · 5.1M/wk sass vs bootstrap ★ 174.3K · 3.0M/wk sass vs bulma ★ 50.1K · 167.8K/wk sass vs @linaria/core ★ 12.3K · 316.2K/wk sass vs @pandacss/dev ★ 6.1K · 172.8K/wk sass vs goober ★ 3.3K · 3.5M/wk