Skip to content

💎 A Ruby library that will communicate with Embedded Dart Sass using the Embedded Sass protocol

License

Notifications You must be signed in to change notification settings

sass-contrib/sass-embedded-host-ruby

Repository files navigation

Embedded Sass Host for Ruby

build gem

This is a Ruby library that implements the host side of theEmbedded Sass protocol.

It exposes a Ruby API for Sass that's backed by a nativeDart Sassexecutable.

Install

gem install sass-embedded

Usage

The Ruby API provides two entrypoints for compiling Sass to CSS.

  • Sass.compiletakes a path to a Sass file and return the result of compiling that file to CSS.
require'sass-embedded'

result=Sass.compile('style.scss')
putsresult.css

compressed=Sass.compile('style.scss',style::compressed)
putscompressed.css
  • Sass.compile_stringtakes a string that represents the contents of a Sass file and return the result of compiling that file to CSS.
require'sass-embedded'

result=Sass.compile_string('h1 { font-size: 40px; }')
putsresult.css

compressed=Sass.compile_string('h1 { font-size: 40px; }',style::compressed)
putscompressed.css

Seerubydoc.info/gems/sass-embedded/Sassfor full API documentation.


Disclaimer: this is not an official Google product.