sass2less

0.1.4 • Public • Published

sass2less

A SCSS to Less loader for webpack. For the creation themes in Ant Design.

It's experimental alpha version!!!

Getting Started

It is understood that you have installed less and less-loader .

To begin, you'll need to install sass2less :

$ yarn add sass2less

CLI

$ yarn global add sass2less
sass2less < SASS_SCSS_file_path >

Then add the loader to your webpack config. For example:

webpack.config.js

const sassRegex = /\.s[sc]ss/i;
 
module.exports = {
    module: {
        rules: [{
            test: sassRegex;
            use: [
                "style-loader",
                "css-loader",
                {
                    loader: "less-loader",
                    options: {
                        sourceMap: !PRODUCTION,
                        prependData: `
                      @import "~antd/dist/antd.less";
                      @import "${__dirname}/src/styles/antd.vars.less";
                    `,
                        lessOptions: {
                            javascriptEnabled: true,
                        },
                    }
                },
                "sass2less"
            ]
        }, ],
    },
};

License

MIT

TODO

  • Tests
  • Convert @each
  • Convert @while
  • Convert @debug
  • Convert @error
  • Convert @warn

Package Sidebar

Install

npm i sass2less

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

10.8 kB

Total Files

22

Last publish

Collaborators

  • mucluck