-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Applying on all pages when using @preprocessor stylus
#1819
Comments
It's a bug in stylus-lang |
@preprocessor stylus
Good to know, unfortunately it is abandoned, it has the most functions to use |
Try workarounds in this list and if none helps, try reporting the problem in https://github.com/stylus/stylus/issues/ |
Thanks, I will try |
For some reason this @-moz-document domain("example.com") {
@media (min-width: 10px) {
p {
color: #000
}
@media (min-height: 20px) {
p {
color: #fff
}
}
}
} compiles to @-moz-document domain("example.com") {
@media (min-width: 10px) {
p {
color: #000;
}
}
}
@media (min-width: 10px) and (min-height: 20px) {
p {
color: #fff;
}
} The easiest solution would be to not nest @-moz-document domain("example.com") {
@media (min-width: 10px) {
p {
color: #000
}
}
@media (min-width: 10px) and (min-height: 20px) {
p {
color: #fff
}
}
} I also noticed that more nesting "fixes" it :D @document domain("example.com") {
& {
@media (min-width: 10px) {
p {
color: #000
}
@media (min-height: 20px) {
p {
color: #fff
}
}
}
}
} |
I was about to report a bug relating to the Stylus preprocessor not detecting compiler errors with certain garbled code. After looking at a few issues here, I guess there's no point in creating another, but here it is for the sake of curiosity.
If you install the above UserStyle, you get a stylelint issue, but it will save just fine. If you remove the indentation before the very first comment, or the Is it still the case that you recommend using the Less preprocessor where possible? Any other recommendations relating to that? |
Personally I wouldn't recommend using |
What else is available for making a style that has user-customizable options, though? |
There's no need for preprocessor to use configurable variables. Well, in simple cases, that is. |
To clarify, you don't need |
Bug Report
Bug Description
When using the Stylus preprocessor with nested Media Queries, the styles are applied to all pages.
Screenshots
example.net:
example.com:
CSS Code
System Information
Additional Context
The text was updated successfully, but these errors were encountered: