Official Ruby on Rails integration for Sass, providing asset helpers, glob imports, and configuration options.
sass-rails is the official Ruby on Rails integration gem for the Sass stylesheet language. It enables Rails developers to use Sass/SCSS syntax with Rails' asset pipeline, offering seamless integration and enhanced functionality for managing stylesheets in Rails applications.
Ruby on Rails developers who need to write and manage stylesheets using Sass or SCSS syntax within the Rails asset pipeline.
It provides the official, convention-over-configuration integration with Rails, offering Rails-specific features like glob imports and asset helpers that work natively with the asset pipeline, unlike using raw Sass or Sprockets directives.
Ruby on Rails stylesheet engine for Sass
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
As the official gem, it provides default, convention-over-configuration setup for Sass in Rails, aligning perfectly with Rails project structure and workflows.
Includes Sass functions like asset-url() and image-path() that automatically handle Rails asset paths, ensuring correct references in compiled CSS without manual path adjustments.
Offers special import syntax using Ruby glob patterns, such as @import 'mixins/*', for efficiently importing multiple library files in Rails, though it's best limited to mixins and variables.
Allows customization of Sass options through Rails configuration (config.sass), making it easy to set preferences like syntax type or disable line comments within the Rails environment.
Several Sass compiler options, including :style and :never_update, are not supported as they are fixed by Rails environment, reducing flexibility for advanced customization.
The README warns that glob imports should only be used for pure library files, as they make cascade ordering hard to control for styles, potentially leading to CSS specificity issues.
Tightly integrated with Rails' Sprockets asset pipeline, which can be a bottleneck for teams wanting to adopt newer, more performant build tools or decouple from Rails conventions.