Answer the question
In order to leave comments, you need to log in
Is it possible to "feed" the Stylus variable to JS (Vue, webpack)?
The question arose, is it possible to make Stylus variables available to Javascript? I need to inline the style, but doing it manually is inconvenient, the whole essence of the components is lost.
Example.
There is a stylus file.
There is a single-file Vue component, likehello.styl
$super-color = #777
<template>
<h1 :style="'color': superColor">Hello</h1>
</template
require ('hello.styl')
export default {
data () {
return {
superColor: ''
}
}
}
superColor
? Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question