pax_global_header00006660000000000000000000000064135247724530014526gustar00rootroot0000000000000052 comment=0e1ecaf37802ab09a9fd9ef9b2dea9475cb4abb7 grunt-sass-3.1.0/000077500000000000000000000000001352477245300136355ustar00rootroot00000000000000grunt-sass-3.1.0/.editorconfig000066400000000000000000000002571352477245300163160ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 grunt-sass-3.1.0/.gitattributes000066400000000000000000000000231352477245300165230ustar00rootroot00000000000000* text=auto eol=lf grunt-sass-3.1.0/.github/000077500000000000000000000000001352477245300151755ustar00rootroot00000000000000grunt-sass-3.1.0/.github/funding.yml000066400000000000000000000001611352477245300173500ustar00rootroot00000000000000github: sindresorhus open_collective: sindresorhus patreon: sindresorhus custom: https://sindresorhus.com/donate grunt-sass-3.1.0/.gitignore000066400000000000000000000000271352477245300156240ustar00rootroot00000000000000node_modules yarn.lock grunt-sass-3.1.0/.npmrc000066400000000000000000000000231352477245300147500ustar00rootroot00000000000000package-lock=false grunt-sass-3.1.0/.travis.yml000066400000000000000000000000541352477245300157450ustar00rootroot00000000000000language: node_js node_js: - '10' - '8' grunt-sass-3.1.0/gruntfile.js000066400000000000000000000025311352477245300161730ustar00rootroot00000000000000'use strict'; const sass = require('node-sass'); module.exports = grunt => { grunt.initConfig({ sass: { options: { implementation: sass }, compile: { files: { 'test/tmp/compile.css': 'test/fixtures/test.scss', 'test/tmp/compile2.css': 'test/fixtures/test.scss' } }, includePaths: { options: { includePaths: ['test/fixtures'] }, files: { 'test/tmp/include-paths.css': 'test/fixtures/include-paths.scss' } }, ignorePartials: { cwd: 'test/fixtures/partials', src: '*.scss', dest: 'test/tmp', expand: true, ext: '.css' }, sourceMap: { options: { sourceMap: 'test/tmp/source-map.css.map' }, files: { 'test/tmp/source-map.css': 'test/fixtures/test.scss' } }, sourceMapSimple: { options: { sourceMap: true }, files: { 'test/tmp/source-map-simple.css': 'test/fixtures/test.scss' } }, precision: { options: { precision: 3 }, files: { 'test/tmp/precision.css': 'test/fixtures/precision.scss' } } }, nodeunit: { tasks: ['test/test.js'] }, clean: { test: ['test/tmp/**'] } }); grunt.loadTasks('tasks'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-nodeunit'); grunt.registerTask('default', ['clean', 'sass', 'nodeunit', 'clean']); }; grunt-sass-3.1.0/license000066400000000000000000000021251352477245300152020ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. grunt-sass-3.1.0/package.json000066400000000000000000000013231352477245300161220ustar00rootroot00000000000000{ "name": "grunt-sass", "version": "3.1.0", "description": "Compile Sass to CSS using node-sass", "license": "MIT", "repository": "sindresorhus/grunt-sass", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && grunt" }, "files": [ "tasks" ], "keywords": [ "gruntplugin", "css", "sass", "scss", "style", "compile", "preprocess", "libsass" ], "devDependencies": { "grunt": "^1.0.3", "grunt-cli": "^1.3.1", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-nodeunit": "^2.0.0", "node-sass": "^4.9.3", "xo": "^0.23.0" }, "peerDependencies": { "grunt": ">=1" } } grunt-sass-3.1.0/readme.md000066400000000000000000000053601352477245300154200ustar00rootroot00000000000000# grunt-sass [![Build Status](https://travis-ci.org/sindresorhus/grunt-sass.svg?branch=master)](https://travis-ci.org/sindresorhus/grunt-sass) [](https://sass-lang.com) > Compile Sass to CSS using [Dart Sass][] or [Node Sass][]. [Dart Sass]: http://sass-lang.com/dart-sass [Node Sass]: https://github.com/sass/node-sass Before filing an issue with this repository, please consider: * Asking support questions on Use [Stack Overflow][]. * Reporting issues with the output on the [Dart Sass][Dart Sass issues] or [LibSass][LibSass issues] issue trackers, depending which implementation you're using. * Reporting installation issues on the [Dart Sass][Dart Sass issues] or [Node Sass][Node Sass issues] issue trackers, depending on which implementation you're using. [Stack Overflow]: https://stackoverflow.com/questions/tagged/node-sass [Dart Sass issues]: https://github.com/sass/dart-sass/issues/new [LibSass issues]: https://github.com/sass/libsass/issues/new [Node Sass issues]: https://github.com/sass/node-sass/issues/new ## Install ``` $ npm install --save-dev node-sass grunt-sass ``` ## Usage ```js const sass = require('node-sass'); require('load-grunt-tasks')(grunt); grunt.initConfig({ sass: { options: { implementation: sass, sourceMap: true }, dist: { files: { 'main.css': 'main.scss' } } } }); grunt.registerTask('default', ['sass']); ``` You can choose whether to use [Dart Sass][] or [Node Sass][] by passing the module to the `implementation` option. One implementation or the other *must* be passed. Note that when using Dart Sass, **synchronous compilation is twice as fast as asynchronous compilation** by default, due to the overhead of asynchronous callbacks. To avoid this overhead, you can use the [`fibers`](https://www.npmjs.com/package/fibers) package to call asynchronous importers from the synchronous code path. To enable this, pass the `Fiber` class to the `fiber` option: ```js const Fiber = require('fibers'); const sass = require('node-sass'); require('load-grunt-tasks')(grunt); grunt.initConfig({ sass: { options: { implementation: sass, fiber: Fiber, sourceMap: true }, dist: { files: { 'main.css': 'main.scss' } } } }); grunt.registerTask('default', ['sass']); ``` Files starting with `_` are ignored to match the expected [Sass partial behaviour](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#partials). ## Options See the Node Sass [options](https://github.com/sass/node-sass#options), except for `file`, `outFile`, `success`, `error`. The default value for the `precision` option is `10`, so you don't have to change it when using Bootstrap. grunt-sass-3.1.0/tasks/000077500000000000000000000000001352477245300147625ustar00rootroot00000000000000grunt-sass-3.1.0/tasks/sass.js000066400000000000000000000021671352477245300162770ustar00rootroot00000000000000/* eslint-disable prefer-object-spread, promise/prefer-await-to-then */ 'use strict'; const util = require('util'); const path = require('path'); module.exports = grunt => { grunt.registerMultiTask('sass', 'Compile Sass to CSS', function () { const done = this.async(); const options = this.options({ precision: 10 }); if (!options.implementation) { grunt.fatal('The implementation option must be passed to the Sass task'); } grunt.verbose.writeln(`\n${options.implementation.info}\n`); (async () => { await Promise.all(this.files.map(async item => { const [src] = item.src; if (!src || path.basename(src)[0] === '_') { return; } const result = await util.promisify(options.implementation.render)(Object.assign({}, options, { file: src, outFile: item.dest })); grunt.file.write(item.dest, result.css); if (options.sourceMap) { const filePath = options.sourceMap === true ? `${item.dest}.map` : options.sourceMap; grunt.file.write(filePath, result.map); } })); })().catch(error => { grunt.fatal(error.formatted || error); }).then(done); }); }; grunt-sass-3.1.0/test/000077500000000000000000000000001352477245300146145ustar00rootroot00000000000000grunt-sass-3.1.0/test/expected/000077500000000000000000000000001352477245300164155ustar00rootroot00000000000000grunt-sass-3.1.0/test/expected/compile.css000066400000000000000000000003171352477245300205600ustar00rootroot00000000000000li { font-family: serif; font-weight: bold; font-size: 1.2em; } .content-navigation { border-color: #3bbfce; color: #2ca2af; } .border { padding: 8px; margin: 8px; border-color: #3bbfce; } grunt-sass-3.1.0/test/expected/include-paths.css000066400000000000000000000003171352477245300216700ustar00rootroot00000000000000li { font-family: serif; font-weight: bold; font-size: 1.2em; } .content-navigation { border-color: #3bbfce; color: #2ca2af; } .border { padding: 8px; margin: 8px; border-color: #3bbfce; } grunt-sass-3.1.0/test/fixtures/000077500000000000000000000000001352477245300164655ustar00rootroot00000000000000grunt-sass-3.1.0/test/fixtures/image-path.scss000066400000000000000000000001021352477245300213670ustar00rootroot00000000000000.background-image { background-image: image-url('image.png'); } grunt-sass-3.1.0/test/fixtures/imported.scss000066400000000000000000000001031352477245300211770ustar00rootroot00000000000000li { font: { family: serif; weight: bold; size: 1.2em; } } grunt-sass-3.1.0/test/fixtures/include-paths.scss000066400000000000000000000003271352477245300221240ustar00rootroot00000000000000@import 'imported'; $blue: #3bbfce; $margin: 16px; .content-navigation { border-color: $blue; color: darken($blue, 9%); } .border { padding: $margin / 2; margin: $margin / 2; border-color: $blue; } grunt-sass-3.1.0/test/fixtures/partials/000077500000000000000000000000001352477245300203045ustar00rootroot00000000000000grunt-sass-3.1.0/test/fixtures/partials/_partial.scss000066400000000000000000000000261352477245300227720ustar00rootroot00000000000000.foo { color: red; } grunt-sass-3.1.0/test/fixtures/precision.scss000066400000000000000000000000501352477245300213500ustar00rootroot00000000000000p { line-height: 1.3432423534532423; } grunt-sass-3.1.0/test/fixtures/test.scss000066400000000000000000000003201352477245300203340ustar00rootroot00000000000000@import 'imported'; $blue: #3bbfce; $margin: 16px; .content-navigation { border-color: $blue; color: darken($blue, 9%); } .border { padding: $margin / 2; margin: $margin / 2; border-color: $blue; } grunt-sass-3.1.0/test/test.js000077500000000000000000000034361352477245300161420ustar00rootroot00000000000000'use strict'; const grunt = require('grunt'); exports.sass = { compile(test) { test.expect(2); const actual = grunt.file.read('test/tmp/compile.css'); const actual2 = grunt.file.read('test/tmp/compile2.css'); const expected = grunt.file.read('test/expected/compile.css'); test.equal(actual, expected, 'should compile SCSS to CSS'); test.equal(actual2, expected, 'should compile SCSS to CSS'); test.done(); }, includePaths(test) { test.expect(1); const actual = grunt.file.read('test/tmp/include-paths.css'); const expected = grunt.file.read('test/expected/include-paths.css'); test.equal(actual, expected, 'should compile SCSS to CSS with options'); test.done(); }, ignorePartials(test) { test.expect(1); test.ok(!grunt.file.exists('test/tmp/_partial.css'), 'underscore partial files should be ignored'); test.done(); }, sourceMap(test) { test.expect(2); const css = grunt.file.read('test/tmp/source-map.css'); test.ok(/\/\*# sourceMappingURL=source-map\.css\.map/.test(css), 'should include sourceMapppingUrl'); const map = grunt.file.read('test/tmp/source-map.css.map'); test.ok(/test\.scss/.test(map), 'should include the main file in sourceMap at least'); test.done(); }, sourceMapSimple(test) { test.expect(2); const css = grunt.file.read('test/tmp/source-map-simple.css'); test.ok(/\/\*# sourceMappingURL=source-map-simple\.css\.map/.test(css), 'should include sourceMappingUrl'); const map = grunt.file.read('test/tmp/source-map-simple.css.map'); test.ok(/test\.scss"/.test(map), 'should include the main file in sourceMap at least'); test.done(); }, precision(test) { test.expect(1); const actual = grunt.file.read('test/tmp/precision.css'); test.ok(/1\.343/.test(actual), 'should support precision option'); test.done(); } };