本文介绍了SCSS编译错误:期望颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有问题的实时页面

http://a.nyaii.com

正在编译.scss文件时发生错误.我对HTML/CSS并不陌生,但是.scss对我来说是全新的,因此我不知道如何解决此问题.任何解决方案或提示都将不胜感激.

There is an error when .scss file is being compiled. I'm not unfamiliar with HTML/CSS, but .scss is totally new to me, so I have no clue how to fix this. Any solutions or hints are greatly appreciated.

此页面使用joomla使用Gantry 5模板构建.在包含来自 MaterializeCSS 的.scss文件后,出现此错误.

This page is built with Gantry 5 template using joomla. After I include .scss files from MaterializeCSS I get this error.

相关行是:

行触发错误在_variables.scss第2-3行中找到

line triggering error Found in _variables.scss line 2-3

$primary-color: color("materialize-red", "lighten-2") !default;
$primary-color-light: lighten($primary-color, 15%) !default;

功能颜色的定义在_color.scss第402行中找到

definition of function color Found in _color.scss line 402

  @function color($color, $type) {
    @if map-has-key($colors, $color) {
      $curr_color: map-get($colors, $color);
      @if map-has-key($curr_color, $type) {
        @return map-get($curr_color, $type);
      }
    }
    @warn "Unknown `#{name}` in $colors.";
    @return null;
  }

在_color.css第340行中找到

$ colors的定义

definition of $colors Found in _color.css line 340

$colors: (
  "materialize-red": $materialize-red,
  "red": $red,
  "pink": $pink,
  "purple": $purple,
  "deep-purple": $deep-purple,
  "indigo": $indigo,
  "blue": $blue,
  "light-blue": $light-blue,
  "cyan": $cyan,
  "teal": $teal,
  "green": $green,
  "light-green": $light-green,
  "lime": $lime,
  "yellow": $yellow,
  "amber": $amber,
  "orange": $orange,
  "deep-orange": $deep-orange,
  "brown": $brown,
  "blue-grey": $blue-grey,
  "grey": $grey,
  "shades": $shades
);

在_color.css第10行中找到的

$ materialize-red 的定义

definition of $materialize-red Found in _color.css line 10

$materialize-red: (
  "lighten-5":  #fdeaeb,
  "lighten-4":  #f8c1c3,
  "lighten-3":  #f3989b,
  "lighten-2":  #ee6e73,
  "lighten-1":  #ea454b,
  "base":       #e51c23,
  "darken-1":   #d0181e,
  "darken-2":   #b9151b,
  "darken-3":   #a21318,
  "darken-4":   #8b1014,
);

以上代码可在此处找到: http://a.nyaii.com/templates/rt_antares/custom/scss /materialize.scss http://a.nyaii.com/templates/rt_antares/custom /scss/components/_variables.scss http://a.nyaii.com/templates/rt_antares/custom /scss/components/_color.scss

Above codes can be found here:http://a.nyaii.com/templates/rt_antares/custom/scss/materialize.scsshttp://a.nyaii.com/templates/rt_antares/custom/scss/components/_variables.scsshttp://a.nyaii.com/templates/rt_antares/custom/scss/components/_color.scss

所有依赖项都可以在这里找到 http://a.nyaii.com/templates/rt_ambrosia/custom/scss/组件/

All dependencies can be found herehttp://a.nyaii.com/templates/rt_ambrosia/custom/scss/components/

推荐答案

这是一个已知的错误,因为Gantry5使用sass 3.2作为编译器,他们正在研究它.参见 https://github.com/gantry/gantry5/issues/1117

This is a known bug because Gantry5 uses sass 3.2 as compiler, they are working on it. See https://github.com/gantry/gantry5/issues/1117

这篇关于SCSS编译错误:期望颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 04:26