【问题标题】:Creating SCSS themes error创建 SCSS 主题错误
【发布时间】: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


    【解决方案1】:

    我找到了解决办法

    只需要写这个

    @import '../../themes.scss';
    

    现在它可以工作了。

    【讨论】:

      猜你喜欢
      • 2017-06-03
      • 1970-01-01
      • 1970-01-01
      • 2021-10-04
      • 1970-01-01
      • 1970-01-01
      • 2022-07-01
      • 2015-03-19
      相关资源
      最近更新 更多