I am using SMUI with svelte and in SCSS I have set the theme colors:
@use 'sass:color';
@use '@material/theme/color-palette';
@use '@material/theme/index' as theme with (
$primary: #ef8611,
$secondary: color.scale(#8aace1, $lightness: 90%),
$surface: #333,
$background: #fff,
$error: color-palette.$red-900
);
The value of $primary
should then then be stored in bare css variable --mdc-theme-primary
but it seems not to be…
The Question is simple:
How can I get the color value of $primary
from scss to JavaScript ? is it possible ?
2
Answers
SCSS Theme File:
In Javascript: