stylus / nib

Stylus mixins, utilities, components, and gradient image generation
http://stylus.github.io/nib
MIT License
1.91k stars 249 forks source link

Nib automatically imports 'text.styl' files in a directory #249

Open ysulyma opened 10 years ago

ysulyma commented 10 years ago

Steps to reproduce

Create two files in the same directory, a.styl and text.styl:

// a.styl
@import 'nib'

// text.styl
*
  color red

On the command line, enter

stylus -u nib -p a.styl

This prints

* {
  color: #f00;
}

rather than nothing (which I would expect).

Cause

lib/nib/index.styl imports several other files, among them @import 'text'. However, there is no text.styl file, instead there is a text/index.styl file. Presumably the import algorithm looks for more $name.styl files before looking for $name/index.styl files.

ysulyma commented 10 years ago

Would it be better to modify the import algorithm, or create text.styl which calls @import 'text/index'?

Volune commented 9 years ago

I had a similar issue with a lib having a normalize.styl which is inappropriately imported by nib.

Fixed it for my project at F4-Group/nib@9cfa2fa24685259c8004d90a5e9d5565cdf8af7a