scss svg作为伪元素,使用自定义颜色变量

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss svg作为伪元素,使用自定义颜色变量相关的知识,希望对你有一定的参考价值。

$icon-checkmark: 'data:image/svg+xml;utf8,<svg viewBox="0 0 15 9.4" xmlns="http://www.w3.org/2000/svg"><path d="M1,4.3 l4.6,4.1 L14,1" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="' + $color-app-blue-dark + '" /></svg>';

.some-element:before {
  content: url($icon-checkmark);
}

// you can control the icon's size by adjusting its parent element

以上是关于scss svg作为伪元素,使用自定义颜色变量的主要内容,如果未能解决你的问题,请参考以下文章

简单的JS+CSS实现网页自定义换肤

如何在 :before 元素的伪元素上添加 svg 作为内容? [复制]

伪元素“内容”属性中的 CSS 变量(自定义属性)

如何在其他 scss 文件中使用角度材质主题颜色变量

将 ACF 字段插入 CSS 伪元素

使用 SASS 函数主题颜色级别在引导程序 4 中创建自定义渐变