Skip to content

Plugins for Lasso.js to support rendering Stylus files to CSS

Notifications You must be signed in to change notification settings

lasso-js/lasso-stylus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lasso-stylus

This plugin for Lasso.js provides support for rendering Stylus dependencies to CSS.

Installation

First install the plugin:

npm install lasso-stylus --save

Then, enable the plugin when configuring Lasso.js:

require('lasso').configure({
        plugins: [
            {
                module: 'lasso-stylus',
                config: {
                    ... // See Configuration below
                }
            }
        ]
    });

Usage

Once this plugin has been enabled, you can then add Stylus dependencies to your browser.json files. The file extension for Stylus files is expected to be .styl. Example:

browser.json:

{
    "dependencies": [
        "style.styl"
    ]
}

Configuration

The configuration for the lasso-stylus plugin supports the following properties:

Example configuration:

require('lasso').configure({
        plugins: [
            {
                module: 'lasso-stylus',
                config: {
                    includes: [nodePath.join(__dirname, 'stylus/mixins/')],
                    use: function(stylus) {
                        stylus.define('add', function(a, b) {
                            a = parseFloat(a);
                            b = parseFloat(b);
                            return a+b;
                        });
                    },
                    define: {
                        sub: function(a, b) {
                            a = parseFloat(a);
                            b = parseFloat(b);
                            return a-b;
                        }
                    },
                    imports: [
                        nodePath.join(__dirname, 'stylus/variables.styl')
                    ]
                }
            }
        ]
    });

About

Plugins for Lasso.js to support rendering Stylus files to CSS

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •