{"id":51152231,"url":"https://github.com/momiji-rs/sasso-ruby","last_synced_at":"2026-06-26T07:02:13.572Z","repository":{"id":364617512,"uuid":"1268596121","full_name":"momiji-rs/sasso-ruby","owner":"momiji-rs","description":"In-process SCSS/Sass → CSS for Ruby, powered by the zero-dependency Rust sasso compiler (a byte-for-byte dart-sass alternative). No Node.js.","archived":false,"fork":false,"pushed_at":"2026-06-25T21:42:26.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T23:12:45.665Z","etag":null,"topics":["css","css-preprocessor","dart-sass","magnus","native-extension","rb-sys","ruby","rubygem","rust","sass","sass-compiler","scss"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/momiji-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-13T18:06:27.000Z","updated_at":"2026-06-25T21:41:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/momiji-rs/sasso-ruby","commit_stats":null,"previous_names":["momiji-rs/sasso-ruby"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/momiji-rs/sasso-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momiji-rs%2Fsasso-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momiji-rs%2Fsasso-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momiji-rs%2Fsasso-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momiji-rs%2Fsasso-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/momiji-rs","download_url":"https://codeload.github.com/momiji-rs/sasso-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momiji-rs%2Fsasso-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34806448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","css-preprocessor","dart-sass","magnus","native-extension","rb-sys","ruby","rubygem","rust","sass","sass-compiler","scss"],"created_at":"2026-06-26T07:02:12.813Z","updated_at":"2026-06-26T07:02:13.539Z","avatar_url":"https://github.com/momiji-rs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sasso (Ruby)\n\n[![Gem Version](https://badge.fury.io/rb/sasso.svg?icon=si%3Arubygems)](https://badge.fury.io/rb/sasso)\n\nIn-process **SCSS / Sass → CSS** compilation for Ruby, backed by [**sasso**](https://github.com/momiji-rs/sasso) — a pure-Rust, dependency-free dart-sass alternative that targets **byte-for-byte parity** with current dart-sass. Shipped as a native extension (Rust via [magnus](https://github.com/matsadler/magnus) + [rb-sys](https://github.com/oxidize-rb/rb-sys)); no Node, no subprocess, no Dart VM.\n\n\u003e This gem is the Ruby binding. The compiler core lives in the separate\n\u003e [`momiji-rs/sasso`](https://github.com/momiji-rs/sasso) repo (crate on\n\u003e crates.io); this gem pins it exactly and releases on its own cadence.\n\n## Install\n\n```ruby\n# Gemfile\ngem \"sasso\"\n```\n\n```console\n$ bundle install\n```\n\nPrecompiled native gems ship for common platforms (Linux gnu/musl, macOS, and\nWindows on x86_64/arm64), so no Rust toolchain is needed. On other platforms the\ngem compiles from source via `cargo` (needs a Rust toolchain).\n\n## Usage\n\n```ruby\nrequire \"sasso\"\n\nSasso.compile_string(\"$c: #336699; a { color: $c; \u0026:hover { color: red } }\")\n# =\u003e \"a {\\n  color: #336699;\\n}\\na:hover {\\n  color: red;\\n}\\n\"\n\n# Minified:\nSasso.compile_string(\"a { b: 1px }\", style: :compressed)   # =\u003e \"a{b:1px}\"\n\n# Indented .sass syntax:\nSasso.compile_string(\"a\\n  b: 1px\\n\", indented: true)\n\n# A file (syntax inferred from the extension; diagnostics get the file name):\nSasso.compile(\"app/assets/stylesheets/application.scss\",\n              style: :compressed, load_paths: [\"vendor/stylesheets\"])\n```\n\n### Options (`compile_string` / `compile`)\n\n| Option | Default | Meaning |\n| --- | --- | --- |\n| `style:` | `:expanded` | `:expanded` or `:compressed` |\n| `syntax:` | `:scss` | `:scss`, `:sass`, or `:css` |\n| `indented:` | `false` | shorthand for `syntax: :sass` |\n| `load_paths:` | `[]` | directories searched for `@use`/`@forward`/`@import` |\n| `url:` | `nil` | filename shown in diagnostics (enables the rich dart-style error block) |\n| `alert_ascii:` | `false` | ASCII-only diagnostics |\n\n### Errors\n\nA compile failure raises `Sasso::CompileError` (a `Sasso::Error \u003c StandardError`)\nwhose `#message` is the compiler's full diagnostic — the same text the `sasso`\nCLI prints.\n\n```ruby\nbegin\n  Sasso.compile_string(\"a { b: 1px + 1em }\")\nrescue Sasso::CompileError =\u003e e\n  warn e.message\nend\n```\n\n## Framework integrations\n\nUsing a Ruby web framework? These drop-in gems build on this one and compile\nyour Sass/SCSS **in-process** (no Node, no Dart, no subprocess), byte-for-byte\nidentical to dart-sass — typically ~6–7× faster per compile than the Node `sass`\ndefault:\n\n- **Rails** (Propshaft + Sprockets) — [`sasso-rails`](https://github.com/momiji-rs/sasso-rails)\n- **Bridgetown** — [`bridgetown-sasso`](https://github.com/momiji-rs/bridgetown-sasso)\n- **Hanami** (2.1+) — [`hanami-sasso`](https://github.com/momiji-rs/hanami-sasso)\n\n## Conformance\n\nThe core passes **100% of the *attempted* official sass-spec suite**\nbyte-for-byte against dart-sass; see the\n[core repo](https://github.com/momiji-rs/sasso#conformance). For the inputs\nbelow, `sasso`'s output is **byte-identical to `sass-embedded`** (dart-sass).\n\n## Performance\n\nBecause `sasso` compiles **in-process** (a direct Rust call — no subprocess, no\nIPC, no Dart VM), it avoids the per-call protocol roundtrip of `sass-embedded`\nand the process-spawn cost paid by any out-of-process compiler.\n\nCompiling the same SCSS (variables, nesting, `@for`, math) on an Apple M2 Max,\nRuby 3.4.1:\n\n| | `sasso` (this gem) | `sass-embedded` (dart-sass) | `sassc` (libsass) |\n| --- | --: | --: | --: |\n| Warm — small component (256 B) | **13.5 µs** | 129 µs (**9.5×**) | 1151 µs (85×) |\n| Warm — ~180 rules (5.5 KB) | **237 µs** | 915 µs (**3.8×**) | 10178 µs (43×) |\n| Cold start (`require` + first compile) | **1.1 ms** | 38.5 ms (**35×**) | 35.6 ms (32×) |\n\nParenthesised values are how much slower the other gem is than `sasso`.\n\n- **Per-request compiling** (e.g. a Sinatra route): in-process latency is ~13 µs\n  vs ~129 µs for `sass-embedded`'s pipe roundtrip to its Dart subprocess.\n- **One-shot builds** (e.g. `rails assets:precompile`): the dominant cost is the\n  ~38 ms Dart subprocess spawn, which `sasso` does not pay (~1 ms cold).\n\nThe engine is also heavily perf-tuned (a scoped bump arena, reference-counted\nvalues). Numbers are representative of one machine; run your own with your\nstylesheets.\n\n## License\n\nMIT, matching the Sass ecosystem (the core `sasso` compiler crate remains\ndual-licensed MIT OR Apache-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomiji-rs%2Fsasso-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomiji-rs%2Fsasso-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomiji-rs%2Fsasso-ruby/lists"}