Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chriseppstein/sass-globbing
Adds glob-based imports to Sass
https://github.com/chriseppstein/sass-globbing
Last synced: 15 days ago
JSON representation
Adds glob-based imports to Sass
- Host: GitHub
- URL: https://github.com/chriseppstein/sass-globbing
- Owner: chriseppstein
- License: mit
- Created: 2011-06-04T23:19:30.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2016-10-06T13:37:45.000Z (about 8 years ago)
- Last Synced: 2024-10-16T08:49:54.991Z (29 days ago)
- Language: CSS
- Homepage:
- Size: 115 KB
- Stars: 441
- Watchers: 19
- Forks: 22
- Open Issues: 5
-
Metadata Files:
- Readme: README.markdown
- Changelog: CHANGELOG.markdown
- License: LICENSE.md
Awesome Lists containing this project
README
# Sass Globbing Plugin
Sass globbing allows you to import many sass or scss files in a single import statement.
## Stylesheet Syntax
Import a folder of files:
@import "library/mixins/*"
Import a tree of files:
@import "library/**/*"
Globbed files are sorted alphabetically before importing them.
Globs are always relative to the current file. The ruby glob file syntax is used, read the [docs][globbing_docs] for more that you can do with it.
## Installation
$ gem install sass-globbing
## Use with the Sass command line
$ sass -r sass-globbing --watch sass_dir:css_dir
## Use with compass
Add the following to your compass configuration:
require 'sass-globbing'
## Use with Ruby on Rails
Ruby on Rails has this capability out of the box starting in Rails 3.1. Do not install this plugin if you use Rails 3.1 or greater.
## Caveats
CSS is order dependent, as such, using this approach within your stylesheets to import styles that depend on the stylesheet's cascade creates an opportunity for styles to change more unpredictably than a manually asserted order. It is recommended that you only use globbing where order is unimportant; E.g. importing of library files.
[globbing_docs]: http://ruby-doc.org/core/classes/Dir.html#method-c-glob