sajad torkamani

What is the dartsass-rails gem?

The dartsass-rails gem wraps the standalone executable version of the Dart version of Sass. It provides a number of commands that let you create .css files from your .scss files.

Installation

  • Run ./bin/bundle add dartsass-rails
  • Run ./bin/rails dartsass:install
  • Delete default app/assets/stylesheets/application.css if present
  • Run ./bin/dev

The installer creates default input Sass file at app/assets/stylesheets/application.scss.

Commands

rails dartsass:watch

Start a process to watch for changes in your input file and generate the output file.

Alternatively, you can use ./bin/dev to start dartsass:watch and rails server in the same terminal.

rails dartsass:build

Generate app/assets/builds/application.css from app/assets/stylesheets/application.scss

Sources