Replies: 1 comment
-
To add: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
You can report stylus preprocessor bugs here: https://github.com/stylus/stylus/issues
Stylus preprocessor Docs: https://stylus-lang.com/docs/
UserCSS Docs: https://github.com/openstyles/stylus/wiki/Writing-UserCSS#stylus
Pretty much all of the bugs below you can fix by using:
@css{}
- https://stylus-lang.com/docs/literal.html#css-literalunquote()
- https://stylus-lang.com/docs/bifs.html#unquote-str-idents()
- https://stylus-lang.com/docs/bifs.html#s-fmt"%s" % val
- https://stylus-lang.com/docs/operators.html#sprintf\
- https://stylus-lang.com/docs/escape.html#char-escapingBugs
rgb(255 255 255 / 20%)
- Colors Module Level 4 Syntaxstylus/stylus#2489
You can quickly convert them to older syntax in the stylus editor using the color picker. Click on the switch formats icon (↔) and then again while holding shift.
calc(stylusVars)
You can’t use stylus variables inside calc(). This is intended behavior.
stylus/stylus#1766 | #1584
url()
- Data URLsstylus/stylus#2597 | stylus/stylus#2347 | stylus/stylus#2117
stylus/stylus#2243
grid-template
stylus/stylus#2306
Because stylus allows to omit colons and semicolons, you can’t split values into separate lines
stylus/stylus#2293
@supports selector()
stylus/stylus#2738
@media
- Media Queries Level 4 Syntaxstylus/stylus#2317 | stylus/stylus#2215 | stylus/stylus#2831
@container
stylus/stylus#2746
min()
max()
css functionsStylus preprocessors min() max() functions override build-in css min() max() functions
stylus/stylus#2584
#decor
- ID selectors similar to hex colors and operatorsIDs that start with: a, b, c, d, e, f (similar to hex color) and end with: or, and, is, isnt, unless, not, null (operators) cause error
stylus/stylus#2140
:is(a, b)
:where(a, b)
:has(a, b)
:not(a, b)
with nestingstylus/stylus#2774
stylus/stylus#2750 | stylus/stylus#2710 | stylus/stylus#2694
[style="color: rgb(0, 0, 0)"]
stylus/stylus#2378 | stylus/stylus#2658
.foo\:bar
stylus/stylus#2805
color-mix()
#1694
{
- opening bracket in a new lineThis indentation style is not fully supported. You can see supported style syntax here.
#1730 | stylus/stylus#2847
Additional Stylus Preprocessor Info
Type of
https://stylus-lang.com/docs/bifs.html#typeof-node
Equality
https://stylus-lang.com/docs/operators.html#equality-relational | https://stylus-lang.com/docs/functions.html#conditionals
Colors
Colors are converted to hex or rgba on output
Sprintf
"%s" % val
vss("%s", val)
Comments
https://stylus-lang.com/docs/comments.html
Input
Output
Less Preprocessor
If you chose Stylus Preprocessor just because it has the same name as the extension and you only use
if
statements and variables, then maybe try Less Preprocessor instead. It’s also very powerful and not that buggy.Standard CSS is also evolving. Preprocessors are slowly starting to become obsolete. CSS Nesting is supported natively. @container: Style queries for custom properties can be used as if statement (
@container style(--bgImg: 1){}
). You can mix colors using color-mix() function.An example of the same style in every
@preprocessor
(stylus, less, uso, default)Beta Was this translation helpful? Give feedback.
All reactions