# stylus-import-tree

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

Latest version **0.1.10** (published 2013-11-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install stylus-import-tree
pnpm add stylus-import-tree
yarn add stylus-import-tree
bun add stylus-import-tree
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.10 |
| Published | 2013-11-12 |
| First published | 2013-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Derek Petersen |
| Maintainers | tuxracer |
| Keywords | stylus, css, directory, recursive, import, grunt |

## Links

- npm: https://www.npmjs.com/package/stylus-import-tree
- Repository: https://github.com/tuxracer/stylus-import-tree
- Issues: https://github.com/tuxracer/stylus-import-tree/issues
- npm.io page: https://npm.io/package/stylus-import-tree

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ~3.2.6
- [stylus](https://npm.io/package/stylus.md) >=0.37
- [underscore](https://npm.io/package/underscore.md) ~1.5.1

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.10 (latest) — 2013-11-12
- 0.1.9 — 2013-11-12
- 0.1.8 — 2013-09-03
- 0.1.7 — 2013-08-16
- 0.1.6 — 2013-08-16
- 0.1.5 — 2013-08-16
- 0.1.4 — 2013-08-16
- 0.1.3 — 2013-08-16
- 0.1.2 — 2013-08-16
- 0.1.1 — 2013-08-15
- 0.1.0 — 2013-08-15
- 0.0.2 — 2013-08-15
- 0.0.1-beta — 2013-08-14

## README

# stylus-import-tree

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

```stylus
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](http://gruntjs.com/), or import them separately:

```stylus
@import 'variables'
@import 'base'

import_tree('./modules')
```

## Setup
You can setup this plugin using [define](https://github.com/LearnBoost/stylus/blob/master/docs/js.md#definename-fn)

### Standalone
```coffeescript
importTree = require 'stylus-import-tree'

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

### Grunt
```coffeescript
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](https://github.com/ixti/stylus-import-tree) by Aleksey V. Zapparov.

## License
[MIT](https://github.com/tuxracer/stylus-import-tree/blob/master/LICENSE)

---
_Source: https://npm.io/package/stylus-import-tree · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
