Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.
/ grunt-sass2scss Public archive

Convert Sass files to SCSS files with sass2scss

License

Notifications You must be signed in to change notification settings

paazmaya/grunt-sass2scss

Repository files navigation

grunt-sass2scss

Convert Sass files to SCSS files with sass2scss

Build Status Built with Grunt Using sass2scss

Getting Started

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');

The "sass2scss" task

Overview

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.
    }
  }
});

Options

options.binPath

Type: String

Default value: 'sass2scss'

Path to the sass2scss binary, which by default is assumed to be found from the system PATH.

options.args

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.

Usage Examples

Default Options

grunt.initConfig({
  sass2css: {
     defaultOptions: {
        files: {
          'tmp/default-1.scss': ['test/fixtures/styles-1.sass']
        }
      }
  }
});

Contributing

"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.

Release History

Changes happening across different versions and upcoming changes are tracked in the CHANGELOG.md file.

License

Copyright (c) Juga Paazmaya paazmaya@yahoo.com

Licensed under the MIT license.

About

Convert Sass files to SCSS files with sass2scss

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •