[Vuejs]-Access scss variable from <template> of VueJS component

0👍

You could set your variables in a javascript file, import the file into your component and then access them from that instead?

👤Nate

5👍

Try this out, Declare your variables in scss file and export it.

like this
In scss

$white-color: #fff;

:export {
  whitecolor: $white-color;
}

In ts

import variables from 'variables.scss';

primary = variables.whitecolor;

In HTML

<progress-bar :val="value" size="large" :bar-color="primary"></progress-bar>

Leave a comment