【发布时间】:2018-08-23 02:50:58
【问题描述】:
我在/javascript/components/themes.scss 下有文件themes.scss
这是里面的代码
$themes: (
flysmarter:(
searchFieldBorder:1px solid #0A5AA6,
searchFieldBackgound:#FFF,
searchFieldColor: #0A5AA6,
),
flygcity:(
backgroundColor:#eccc00,
),
);
@mixin themify($themes) {
@each $theme, $map in $themes {
.theme-#{$theme} & {
$theme-map: () !global;
@each $key, $submap in $map {
$value: map-get(map-get($themes, $theme), '#{$key}');
$theme-map: map-merge($theme-map, ($key: $value)) !global;
}
@content;
$theme-map: null !global;
}
}
}
@function themed($key) {
@return map-get($theme-map, $key);
}
我需要将它导入到 ../components/searchfield/styles/searchfield.css 下的文件中
我这样写了 import @import url('../component/themes.scss');
但是当我运行 webpack 时出现了这个错误。
模块构建失败: @include 主题化($主题){ ^ 没有名为themify的mixin
当文件在同一目录时,一切正常。 我该如何解决?
【问题讨论】:
标签: css ruby-on-rails webpack sass