Imports component #9

Merged
merged 5 commits into from Feb 25, 2014

2 participants

@kewah

Hi,
I added the ability to import another components stylus file. For instance https://github.com/kewah/component-stylus-plugin/blob/imports-component/test/fixtures/with-import/index.styl

I also added tests.

Let me know if I broke something from your previous version. Without tests it's a bit complicated ;)

One downside with this implementation is, we must be careful to not import files containing CSS properties, otherwise they will be duplicated in the output.

Related to #6

kewah added some commits Feb 25, 2014
@kewah kewah Forgotten var e9aa079
@kewah kewah `file` var isn't used 058119f
@kewah kewah Ability to import another component's stylus file
Add the component's dependencies (local and online) to `options.paths`.
We are now able to import another stylus file directly inside the component.

```
{
  ...
  "local": [
    "base-styles"
  ],
}
```

```
@import "base-styles/animation-mixin";
```

However, we must be careful not to import files containing CSS properties, otherwise they will be duplicated in the output.

Related to #6
36e11fe
@kewah kewah Dependencies are already imported 910612d
@kewah kewah Add tests 699e278
@rschmukler
Owner

Wow, this is really cool. Thanks for all of your hard work, fantastic pull request.

@rschmukler rschmukler merged commit 98c0c01 into rschmukler:master Feb 25, 2014
@rschmukler
Owner

@kewah could you also add a little bit to the readme describing how to use this, just so people assessing the plugin see it as a feature.

@kewah
@rschmukler
Owner

Great, thanks so much. Cheers! 🍻

@kewah kewah deleted the unknown repository branch Feb 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment