Skip to content

Is there even a way to use data-theme with stylus? #2823

Closed Answered by slightlyfaulty
AndresMpa asked this question in Q&A
Discussion options

You must be logged in to vote

It sounds like you might be thinking about this the wrong way. Stylus variables are for compile-time values. CSS custom properties are for runtime values. They have different purposes are aren't interchangeable.

If you just want to replace var(--someColor) with someVar in your code, you can literally just do this:

:root
  --someColor snow

someVar = var(--someColor)

.someClass
   color someVar

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@AndresMpa
Comment options

@iChenLei
Comment options

@AndresMpa
Comment options

Comment options

You must be logged in to vote
3 replies
@vendethiel
Comment options

@AndresMpa
Comment options

@vendethiel
Comment options

Answer selected by AndresMpa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants