CSS variable & SCSS mixin

后端 未结 1 1236
面向向阳花
面向向阳花 2021-01-18 16:55

I need to be able to use CSS variables because I need to have an hover effect (background-color) to be customizable by my VueJs app. But my CSS stylesheet should have a defa

相关标签:
1条回答
  • 2021-01-18 17:47

    The "problem" with CSS variables is they can have any value – why map-getter($theme-dark, AppNav, hover) is rendered as is. To instruct SCSS that this is actual SCSS code and not a random string you need to use interpolation (like if you use SCSS variables inside calc):

    --hover-bg-color: #{map-getter($theme-dark, AppNav, hover)};
    
    0 讨论(0)
提交回复
热议问题