stylus/stylus

@import css files may have the same behaviour as @import styl file

Open

#2,360 opened on Feb 21, 2018

View on GitHub
 (2 comments) (4 reactions) (0 assignees)JavaScript (11,125 stars) (1,173 forks)batch import
good first issuehelp wantedt: Enhancement

Description

To follow https://github.com/stylus/stylus/issues/448

I have these files:

file-stylus.styl:

.stylus-rule
  color blue

file-css.css:

.css-rule {
  color: red;
}

main.styl:

.prefix
    @import "file-stylus"
    @import "file-css.css"

Then, I run:

stylus main.styl --include-css

Expected

.prefix .stylus-rule {
  color: #00f;
}
.prefix .css-rule {
  color: red;
}

Actually

.prefix .stylus-rule {
  color: #00f;
}
.css-rule {
  color: red;
}

.stylus-rule is well inside the .prefix class, but not .css-rule.

I don't know but I expected @import ing a css file should have the same behaviour as for a styl file.

(Also I find it not obvious to pass the option --include-css, it should be the default.)

What about you ?

Contributor guide