Skip to content

undocumented @import / @require behavior for index styling #33

Open
allenretz opened this issue Dec 27, 2019 · 0 comments
Open

undocumented @import / @require behavior for index styling #33

allenretz opened this issue Dec 27, 2019 · 0 comments

Comments

@allenretz
Copy link

Stylus currently resolves stylus files if they have the same name as their parent folder (with .styl extension).
For example:
given the following directory structure where test.styl is the input file and test.css is the output file

.
├── a
|   ├── a.styl
├── test.styl
├── test.css

and the following file contents

./test.styl

@require a

./a/a.styl

body
  background-color red

yields the following output
./test.css

body {
  background-color: #f00;
}

this seems like logical and intended behavior, but it appears to not be listed in the documentation ( or at least not in the @import.md index styles section:

@ import also supports index styles. This means when you @import blueprint, it will resolve
either blueprint.styl or blueprint/index.styl. This is really useful for libraries that want to expose all their features, while still allowing feature subsets to be imported.

Unless this behavior is unintended, it should probably be changed to something like:

@ import also supports index styles. This means when you @import blueprint, it will resolve
blueprint.styl, blueprint/index.styl, or blueprint/blueprint.styl . This is really useful for libraries that want to expose all their features, while still allowing feature subsets to be imported.

@iChenLei iChenLei transferred this issue from stylus/stylus Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant