{"id":13463027,"url":"https://github.com/rails/sass-rails","last_synced_at":"2025-04-10T23:27:55.852Z","repository":{"id":45266845,"uuid":"1795273","full_name":"rails/sass-rails","owner":"rails","description":"Ruby on Rails stylesheet engine for Sass","archived":false,"fork":false,"pushed_at":"2020-10-01T19:31:05.000Z","size":538,"stargazers_count":864,"open_issues_count":10,"forks_count":331,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-03-12T03:20:17.419Z","etag":null,"topics":[],"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/rails.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-24T19:37:30.000Z","updated_at":"2025-03-10T23:01:57.000Z","dependencies_parsed_at":"2022-09-10T11:31:10.919Z","dependency_job_id":null,"html_url":"https://github.com/rails/sass-rails","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails%2Fsass-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails%2Fsass-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails%2Fsass-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails%2Fsass-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rails","download_url":"https://codeload.github.com/rails/sass-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244207720,"owners_count":20416106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T13:00:44.391Z","updated_at":"2025-03-27T14:07:04.873Z","avatar_url":"https://github.com/rails.png","language":"Ruby","funding_links":[],"categories":["CSS","CSS and Styling","Tools"],"sub_categories":["CSS with Ruby","Miscellaneous"],"readme":"# Official Ruby-on-Rails Integration with Sass\n\nThis gem provides official integration for Ruby on Rails projects with the Sass stylesheet language.\n\n## Installing\n\nSince Rails 3.1, new Rails projects will be already configured to use Sass. If you are upgrading to Rails 3.1 you will need to add the following to your Gemfile:\n\n```ruby\ngem 'sass-rails'\n```\n\n## Configuration\n\nTo configure Sass via Rails set use `config.sass` in your\napplication and/or environment files to set configuration\nproperties that will be passed to Sass.\n\n### Options\n\n- `preferred_syntax` - This option determines the default Sass syntax and file extensions that will be used by Rails generators. Can be `:scss` (default CSS-compatible SCSS syntax) or `:sass` (indented Sass syntax).\n\nThe [list of supported Sass options](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options)\ncan be found on the Sass Website with the following caveats:\n\n- `:style` - This option is not supported. This is determined by the Rails environment. It's `:expanded` only on development, otherwise it's `:compressed`.\n- `:never_update` - This option is not supported. Instead set `config.assets.enabled = false`\n- `:always_update` - This option is not supported. Sprockets uses a controller to access stylesheets in development mode instead of a full scan for changed files.\n- `:always_check` - This option is not supported. Sprockets always checks in development.\n- `:syntax` - This is determined by the file's extensions.\n- `:filename` - This is determined by the file's name.\n- `:line` - This is provided by the template handler.\n\n### Example\n```ruby\nMyProject::Application.configure do\n  config.sass.preferred_syntax = :sass\n  config.sass.line_comments = false\n  config.sass.cache = false\nend\n```\n\n## Important Note\n\nSprockets provides some directives that are placed inside of comments called `require`, `require_tree`, and\n`require_self`. **\u003cspan style=\"color:#c00\"\u003eDO NOT USE THEM IN YOUR SASS/SCSS FILES.\u003c/span\u003e** They are very\nprimitive and do not work well with Sass files. Instead, use Sass's native `@import` directive which\n`sass-rails` has customized to integrate with the conventions of your Rails projects.\n\n## Features\n\n### Glob Imports\n\nWhen in Rails, there is a special import syntax that allows you to\nglob imports relative to the folder of the stylesheet that is doing the importing.\n\n* `@import \"mixins/*\"` will import all the files in the mixins folder\n* `@import \"mixins/**/*\"` will import all the files in the mixins tree\n\nAny valid ruby glob may be used. The imports are sorted alphabetically.\n\n**NOTE:** It is recommended that you only use this when importing pure library\nfiles (containing mixins and variables) because it is difficult to control the\ncascade ordering for imports that contain styles using this approach.\n\n### Asset Helpers\nWhen using the asset pipeline, paths to assets must be rewritten.\nWhen referencing assets use the following asset helpers (underscored in Ruby, hyphenated\nin Sass):\n\n#### `asset-path($relative-asset-path)`\nReturns a string to the asset.\n\n* `asset-path(\"rails.png\")` returns `\"/assets/rails.png\"`\n\n#### `asset-url($relative-asset-path)`\nReturns a url reference to the asset.\n\n* `asset-url(\"rails.png\")` returns `url(/assets/rails.png)`\n\nAs a convenience, for each of the following asset classes there are\ncorresponding `-path` and `-url` helpers:\nimage, font, video, audio, javascript, stylesheet.\n\n* `image-path(\"rails.png\")` returns `\"/assets/rails.png\"`\n* `image-url(\"rails.png\")` returns `url(/assets/rails.png)`\n\n#### `asset-data-url($relative-asset-path)`\nReturns a url reference to the Base64-encoded asset at the specified path.\n\n* `asset-data-url(\"rails.png\")` returns `url(data:image/png;base64,iVBORw0K...)`\n\n## Running Tests\n\n    $ bundle install\n    $ bundle exec rake test\n\nIf you need to test against local gems, use Bundler's gem :path option in the Gemfile and also edit `test/support/test_helper.rb` and tell the tests where the gem is checked out.\n\n## Code Status\n\n* [![Travis CI](https://api.travis-ci.org/rails/sass-rails.svg)](http://travis-ci.org/rails/sass-rails)\n* [![Gem Version](https://badge.fury.io/rb/sass-rails.svg)](http://badge.fury.io/rb/sass-rails)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails%2Fsass-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frails%2Fsass-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails%2Fsass-rails/lists"}