o-
Version:
A collection of functions, mixins, and placeholders for sass
97 lines (78 loc) • 1.92 kB
Markdown
> A collection of functions, mixins, and placeholders for [sass][sass-lang]
via npm
```bash
npm install o- --save-dev
```
or through bower
```bash
bower install o-dash --save
```
Import __o-__ into your sass/scss
```scss
@import 'node_modules/o-';
```
As of [node-sass][node-sass] >= v3.0.0, js functions can be registered at
configuration time, which is needed for `o-md-color` and `o-closest-md-color`
functions. You will need [node-sass][node-sass], [gulp-sass][gulp-sass],
or [grunt-sass][grunt-sass] depending on your build setup.
Grunt:
```js
// ...
sass: {
options: {
functions: require('o-')
},
build: {
files: {
'style.css': 'style.scss'
}
}
}
// ...
```
Gulp:
```js
// ...
gulp.task('sass', () => {
return gulp.src('style.scss')
.pipe(sass({
functions: require('o-')
}))
.pipe(gulp.src('style.css'))
})
// ...
```
Node:
```js
// ...
sass.render({
data: `
body {
color: o-closest-md-color(o-random-color())
}
`,
functions: require('o-')
}, (err, result) => {/*...*/})
// ...
```
You can refer to the documentation online at [lokua.github.io/o-][doc-site], or internally by opening
[](doc/index.html).
`NODE_ENV=development && npm install`
If adding a new file, run `npm run gen` afterword to repopulate the `lib/_index.scss`
imports file.
Documentation is generated with the much awesome [sassdoc][sass-doc]. `npm run doc`
[][license]
[]: http://sass-lang.com
[]: http://lokua.net/license-mit.html
[]: http://lokua.github.io/o-
[]: http://sassdoc.com/
[]: https://github.com/dlmanning/gulp-sass
[]: https://github.com/sindresorhus/grunt-sass
[]: https://github.com/sass/node-sass