我试图弄清楚如何创建一个.scss类,该类将根据用户更改主题的时间来存储和更新某些全局主题颜色。这在Angular 9中。
@each $skin,
$data in $skins {
$skin-mask-slight-color: map-get($data, skin-mask-slight);
$skin-text-color: map-get($data, skin-text);
$skin-navbar-color: map-get($data, skin-navbar);
$skin-gradient-start-color: map-get($data, skin-gradient-start);
$skin-gradient-end-color: map-get($data, skin-gradient-end);
$skin-primary-color: map-get($data, skin-btn-primary);
$skin-secondary-color: map-get($data, skin-btn-secondary);
$skin-default-color: map-get($data, skin-btn-default);
.#{$skin}-skin {
// store and update the above variables based on selected theme
}
}
我希望能够访问任何其他.scss类中声明的变量的当前值。
有没有办法做到这一点?