【问题标题】:sass/scss import from variable not possible [duplicate]无法从变量导入 sass/scss [重复]
【发布时间】:2023-03-27 22:25:01
【问题描述】:

大家好,我想在 SCSS 中创建一个用于导入文件的变量:

$theme : 'my_theme';
@import "#{$theme}/import";

但这会给我这个错误:

Syntax error: File to import not found or unreadable: #{$theme}/import.

我还没有找到有关这方面的信息,只有那是不可能的。 是否存在使其工作的解决方法?

谢谢

【问题讨论】:

    标签: sass


    【解决方案1】:

    原始实现仅在插值字符串或 url() 是有效字符串/url 时有效;这意味着您不能包括例如字符串/url中的引号或右括号(例如@import "#{"foo.css"}"

    您可以在此处找到更多信息:
    https://github.com/nex3/sass/issues/49

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-17
      • 1970-01-01
      • 2015-04-07
      相关资源
      最近更新 更多