Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

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

@allenretz

Description

@allenretz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions