Convert Sass files to SCSS files with sass2scss
This plugin requires Grunt ~1.1.0
and Node.js
version to be minimum of 14.15.0
, which is the active Long Term Support (LTS) version,
and sass2scss
binary to be available either via PATH
or defined via configuration.
The sass2scss
tool can only be compiled from sources
at the moment, for example in Linux/Mac:
wget https://github.com/mgreter/sass2scss/archive/v1.1.2.tar.gz
tar zxf v1.1.2.tar.gz
cd sass2scss-1.1.2/
make
[sudo] mv sass2scss /usr/local/bin/
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-sass2scss --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-sass2scss');
In your project's Gruntfile, add a section named sass2scss
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
sass2css: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
}
}
});
Type: String
Default value: 'sass2scss'
Path to the sass2scss
binary, which by default is assumed to be found from
the system PATH.
Type: Array
Default value: []
Command line options for the sass2scss
command line utility.
-p, --pretty pretty print output
-c, --convert convert src comments
-s, --strip strip all comments
-k, --keep keep all comments
-h, --help help text
-v, --version version information
For example to set pretty printing and to keep comments, use ['-p', '-k']
, or
['pretty', 'keep']
. The leading dashes are optional and added automatically when missing.
grunt.initConfig({
sass2css: {
defaultOptions: {
files: {
'tmp/default-1.scss': ['test/fixtures/styles-1.sass']
}
}
}
});
"A Beginner's Guide to Open Source: The Best Advice for Making your First Contribution".
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality.
Lint and test your code using Grunt, via grunt test
command.
Also there is a blog post about "45 Github Issues Dos and Don’ts".
Linting is done with ESLint and can be executed with npm run lint
.
There should be no errors appearing after any JavaScript file changes.
Copyright (c) Juga Paazmaya [email protected]
Licensed under the MIT license.