{"name":"sass-module-importer","version":"1.0.2","main":"lib/index.js","description":"Import Sass files from NPM and Bower Modules","author":{"name":"Lucas Motta","email":"mail@lucasmotta.com","url":"lucasmotta.com"},"repository":{"type":"git","url":"git+https://github.com/lucasmotta/sass-module-importer.git"},"bugs":{"url":"https://github.com/lucasmotta/sass-module-importer/issues"},"license":"MIT","keywords":["sass","scss","importer","module","npm","node-sass","bower"],"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha --compilers js:babel/register","compile":"babel -d lib/ src/","pretest":"eslint src/index.js test.js","preversion":"npm test","prepublish":"npm test && npm run compile","postpublish":"git push"},"devDependencies":{"babel":"^5.8.3","babel-eslint":"^3.1.20","chai":"^3.0.0","eslint":"^0.24.1","eslint-config-mcsaatchi":"^1.0.2","mocha":"^2.2.5","node-sass":"^3.2.0","sass-easing":"^1.0.3"},"dependencies":{"es6-map":"^0.1.1","resolve":"^1.1.6","resolve-bower":"0.0.1"},"gitHead":"c628c2068b7cd45ef94094876c60fa6e44da89bc","homepage":"https://github.com/lucasmotta/sass-module-importer#readme","_id":"sass-module-importer@1.0.2","_shasum":"edb3d39295fd172c247ffbb16d52b964026b21ce","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.4.0","_npmUser":{"name":"lucasmotta","email":"mail@lucasmotta.com"},"maintainers":[{"name":"lucasmotta","email":"mail@lucasmotta.com"}],"dist":{"shasum":"edb3d39295fd172c247ffbb16d52b964026b21ce","tarball":"http://registry-npm.ywwl.com/sass-module-importer/download/sass-module-importer-1.0.2.tgz","integrity":"sha512-BKt0aAVv1cyW68iWVd/WNR8k0q9YQNJs0TBIbpFI2/xa6wucwC0IA/Is9xeioL56yzYNFxy2uz0WvboplaQ0Hw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8gjOwTndV2l1BGeTS9ZYGId4Zc7oHgZv75+zpk6yQPgIhAN2EFITGNNWVK1+qkZD+jO55QEulTmAToszNFxIve7J/"}],"size":9190,"noattachment":false,"key":"/sass-module-importer/-/sass-module-importer-1.0.2.tgz"},"directories":{},"readme":"[![Build Status](https://travis-ci.org/lucasmotta/sass-module-importer.svg?branch=master)](https://travis-ci.org/lucasmotta/sass-module-importer)\n\n# sass-module-importer\n\nSimple importer for [node-sass](https://github.com/sass/node-sass) to import [npm](https://www.npmjs.com) and [bower](http://bower.io/search/) modules.\n\nSay good-bye to all the mess with relative paths on your Sass files.  \nYou can now import your Sass/SCSS modules by referencing to the module name, like this:\n\n```sass\n@import \"sass-easing\";\n@import \"quantum-colors\";\n@import \"inuit-defaults\";\n@import \"inuit-functions\";\n@import \"inuit-mixins\";\n@import \"inuit-box-sizing\";\n@import \"inuit-normalize\";\n@import \"inuit-page\";\n// :)\n```\n\nJust for comparison, look at this mess:\n\n```sass\n@import \"node_modules/sass-easing/_easings.scss\";\n@import \"bower_components/quantum-colors/_quantum-colors.scss\";\n@import \"bower_components/inuit-defaults/settings.defaults\";\n@import \"bower_components/inuit-functions/tools.functions\";\n@import \"bower_components/inuit-mixins/tools.mixins\";\n@import \"bower_components/inuit-normalize/generic.normalize\";\n@import \"bower_components/inuit-box-sizing/generic.box-sizing\";\n@import \"bower_components/inuit-page/base.page\";\n// :(\n```\n\nAssuming that the external library you are installing fits under one of those categories:\n\n1. Set a SCSS/Sass/CSS file on the \"main\" field of their package.json/bower.json\n2. Set a SCSS/Sass/CSS file on the \"style\" field of their package.json/bower.json\n3. Have a `index.css` file on the root of their module\n\nThis tool it will also inline CSS files for you, since Sass [cannot import plain CSS files yet](https://github.com/sass/sass/issues/556). So if the dependency you are using exports a CSS file, it will work too.\n\n\n## How-to\n\n### install\n\n```sh\nnpm install sass-module-importer --save-dev\n```\n\n### use the importer with [node-sass](https://github.com/sass/node-sass) `>= v3.0.0`\n\n```js\nimport sass from 'node-sass';\nimport moduleImporter from 'sass-module-importer';\n\nsass.render({\n  file: './source/css/app.scss',\n  importer: moduleImporter()\n}, cb);\n```\n\n### use the importer with [gulp-sass](https://github.com/dlmanning/gulp-sass)\n\n```js\nimport gulp from 'gulp';\nimport sass from 'gulp-sass';\nimport moduleImporter from 'sass-module-importer';\n\ngulp.task('style', () => {\n  return gulp.src('./source/css/app.scss')\n    .pipe(sass({ importer: moduleImporter() }))\n    .pipe(gulp.dest('./public/css'));\n});\n```\n\n### import partials\n\nIf you need to import partials from your external module, just use the path for the partial you want to import. To import the following file:\n```\nnode_modules/module-name/folder/to/_file.scss\n```\n\nImport like this anywhere:\n\n```scss\n@import \"module-name/folder/to/_file.scss\"\n```\n\n## Options\nYou can pass any option supported by [node-resolve](https://github.com/substack/node-resolve#resolveid-opts-cb) directly, like this:\n```js\nmoduleImporter({ basedir: path.join(__dirname, 'another-folder') });\n```\n\n## Tests\nUse `npm test` to run the tests.\n\n## Issues\nIf you discover a bug, please raise an issue on Github. https://github.com/lucasmotta/sass-module-importer/issues\n\n## Contributors\nThe source code and the test are written in ES6 (ECMAScript 2015).  \n[Buble](https://gitlab.com/Rich-Harris/buble) is being used to compile to ES5 before the package is published to npm.\n","publish_time":1437650889443,"_cnpm_publish_time":1437650889443,"dist-tags":{"latest":"1.4.0"}}