我在这里

🏠 HOME 🗂️ DOCS 🔗 LINK 👴🏻 ABOUT
https://qiniu.sukoshi.xyz/src/images/cover/cover-css.jpeg?x-oss-process=style/webp

在CSS变量中使用SCSS变量无效

2021-06-03 16:30

  • 笔记
  • css
  • scss
<template>
  <!-- Your template -->
</template>

<script>
  export default {
    layout: 'blog'
    // page component definitions
  }
</script>

在SCSS中定义了一个变量,但是在CSS中使用SCSS中定义的变量无效:

$color: #f00;

:root {
  --text-color: $color; /** 无效 */
}

使用#{}Interpolation插值来解决此问题:

$color: #f00;

:root {
  --text-color: #{$color};
}

参考文档:https://sass-lang.com/documentation/interpolation

关于我在某宝花费150元做了一个LOGO是不是伞兵这件事

2021-06-04 20:28

又做了一个WEB端的音频可视化

2021-05-28 19:08

Sukoshi

Sukoshi

不觉得鹿角即可爱又有攻击性吗(

Related Posts

  • CSS使用字体新姿势 unicode-range用法与使用场景
  • ES6中的模块
  • zsh和oh-my-zsh常用配置和命令
  • 日语五十音
  • 五十音补充笔记
  • JavaScript中的GC

Categories

  • 笔记 20
  • 归档记录 9
  • 碎碎念 8
  • QAQ 7
  • doc 6
  • mv 3
show all

Tags

摄影 日常 js 浪 mongodb 日记 碎碎念 canvas cos css git github
show all

© 2022 Sukoshi.

蜀ICP备15014309号

Powered by Hugo Theme - kagome

🌞 light 🌛 dark 🤖️ auto