Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sass-contrib/sass-embedded-host-ruby
:gem: A Ruby library that will communicate with Embedded Dart Sass using the Embedded Sass protocol
https://github.com/sass-contrib/sass-embedded-host-ruby
dart-sass protobuf ruby sass sass-embedded scss
Last synced: 2 days ago
JSON representation
:gem: A Ruby library that will communicate with Embedded Dart Sass using the Embedded Sass protocol
- Host: GitHub
- URL: https://github.com/sass-contrib/sass-embedded-host-ruby
- Owner: sass-contrib
- License: mit
- Created: 2021-05-24T05:06:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-27T04:56:38.000Z (11 days ago)
- Last Synced: 2024-12-29T09:03:55.119Z (9 days ago)
- Topics: dart-sass, protobuf, ruby, sass, sass-embedded, scss
- Language: Ruby
- Homepage: https://rubygems.org/gems/sass-embedded
- Size: 1020 KB
- Stars: 68
- Watchers: 5
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Embedded Sass Host for Ruby
[![build](https://github.com/sass-contrib/sass-embedded-host-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/sass-contrib/sass-embedded-host-ruby/actions/workflows/build.yml)
[![gem](https://badge.fury.io/rb/sass-embedded.svg)](https://rubygems.org/gems/sass-embedded)This is a Ruby library that implements the host side of the [Embedded Sass protocol](https://github.com/sass/sass/blob/HEAD/spec/embedded-protocol.md).
It exposes a Ruby API for Sass that's backed by a native [Dart Sass](https://sass-lang.com/dart-sass) executable.
## Install
``` sh
gem install sass-embedded
```## Usage
The Ruby API provides two entrypoints for compiling Sass to CSS.
- `Sass.compile` takes a path to a Sass file and return the result of compiling that file to CSS.
``` ruby
require 'sass-embedded'result = Sass.compile('style.scss')
puts result.csscompressed = Sass.compile('style.scss', style: :compressed)
puts compressed.css
```- `Sass.compile_string` takes a string that represents the contents of a Sass file and return the result of compiling that file to CSS.
``` ruby
require 'sass-embedded'result = Sass.compile_string('h1 { font-size: 40px; }')
puts result.csscompressed = Sass.compile_string('h1 { font-size: 40px; }', style: :compressed)
puts compressed.css
```See [rubydoc.info/gems/sass-embedded/Sass](https://rubydoc.info/gems/sass-embedded/Sass) for full API documentation.
---
Disclaimer: this is not an official Google product.