0.1.10 • Published 10 years ago

stylus-import-tree v0.1.10

Weekly downloads
41
License
MIT
Repository
github
Last release
10 years ago

stylus-import-tree

This plugin allows you to recursively import entire directories instead of writing bunch of @import statements in your stylus file:

import_tree('./foobar')

// insted of:
// @import 'foobar/a'
// @import 'foobar/b'
// @import 'foobar/c/d'

Import order

Files will be imported in alphabetical order based on filename. To import the files in a specific order you can either name them accordingly, use this plugin in conjunction with a build tool such as Grunt, or import them separately:

@import 'variables'
@import 'base'

import_tree('./modules')

Setup

You can setup this plugin using define

Standalone

importTree = require 'stylus-import-tree'

stylus(str)
.define("import_tree", importTree)
.render (err, css) ->
  throw err if err
  console.log css

Grunt

grunt.initConfig
  stylus:
    dist:
      options:
        define:
          import_tree: require 'stylus-import-tree'
      files:
        'tmp/assets/styles/app.css': ['app/styles/app.styl']

Credit

This is a fork of Style import_tree Proof of Concept by Aleksey V. Zapparov.

License

MIT

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.2

11 years ago

0.0.1-beta

11 years ago