【问题标题】:How to add URL image as scss variable如何将 URL 图像添加为 scss 变量
【发布时间】:2019-10-03 17:29:54
【问题描述】:

我有以下 scss 风格。我已将 bg 颜色添加为变量,并且工作正常。我还需要添加“icons.png”作为变量。

 .home {
           @include themify($themes) {
               background: url(images/icons.png) themed('bgcolor');
           }
    }

如何将“icons.png”添加为名副其实?喜欢

背景:url(images/VARIABLENAME) themed('bgcolor');

【问题讨论】:

  • 什么是“主题”?
  • $themes var 包含什么? themifymixin 是做什么的?

标签: css sass scss-mixins


【解决方案1】:

你可以试试这个。

$image: 'icons.png';  
.home {
       @include themify($themes) {
           background: url(images/${$image}) themed('bgcolor');
       }
}

【讨论】:

    猜你喜欢
    • 2020-05-26
    • 1970-01-01
    • 2022-11-12
    • 2017-06-15
    • 2018-04-27
    • 2013-11-25
    • 1970-01-01
    • 2014-02-24
    • 1970-01-01
    相关资源
    最近更新 更多