语法错误:SASS重复键

时间:2015-03-20 14:01:32

标签: sass

@each是否有可能像这样重复键的列表:

@each $label, $value in (
        anthrazit: #7a7a7a,
        apricot: #ff8c00,
        beige: #deb887,
        blau: #0000cd,
        blaumelange: #0000cd,
        blauvintage: #0000cd,
        blau-gestreift: #0000cd,
        blau-grau: #0000cd,
        blau-kariert: #0000cd,
        bleached: #0000cd,
        bordeaux: #f00,
        bordeaux vintage: #f00,
        braun: #8b4513,
        braunvintage: #8b4513,
        braun-kariert: #8b4513,
        braun-melange: #8b4513,
        brickred: #f00,
        camel: #deb887,
        caramel: #8b4513,
        clean: #0000cd,
        coral: #f00,
        cream: #fffff0,
        denim: #0000cd,
        denimbleached: #0000cd,
        denimbraun: #8b4513,
        denimbraun used: #8b4513,
        denimclean: #0000cd,
        denimdarkwashed: #0000cd,
        denimdestroyed: #0000cd,
        denimgrau: #7a7a7a,
        denimgraubleached: #7a7a7a,
        denimgrauused: #7a7a7a,
        denimgrauwashed: #7a7a7a,
        denimschwarz: #000,
        denimschwarzused: #000,
        denimused: #0000cd,
        denimwashed: #0000cd,
        dunkelbraun: #8b4513,
        electricblue: #0000cd,
        flieder: #8b008b,
        fluogelb: #ff0,
        fluogruen: #228b22,
        fluopink: #ff1493,
        gelb: #ff0,
        grau: #7a7a7a,
        grauvintage: #7a7a7a,
        grau-melange: #7a7a7a,
        gruen: #228b22,
        gruenvintage: #228b22,
        gruen-kariert: #228b22,
        gruen-melange: #228b22,
        hellblau: #0000cd,
        hellblau vintage: #0000cd,
        hellgrau: #7a7a7a,
        hellgrau-melange: #7a7a7a,
        hellgruen: #228b22,
        iceblau: #0000cd,
        karoblau: #0000cd,
        karobraun: #8b4513,
        karogelb: #ff0,
        karograu: #7a7a7a,
        karogruen: #228b22,
        karolila: #8b008b,
        karopink: #ff1493,
        karorot: #f00,
        karoschwarz: #000,
        khaki: #228b22,
        lavendel: #8b008b,
        leder: #000,
        lila: #8b008b,
        mint: #228b22,
        mintvintage: #228b22,
        mittelblau: #0000cd,
        mocca: #8b4513,
        navy: #0000cd,
        navy: #0000cd,
        navyvintage: #0000cd,
        nude: #deb887,
        ocker-gelb: #ff0,
        oliv: #228b22,
        orange: #ff8c00,
        petrolblau: #0000cd,
        pinien-braun: #8b4513,
        pink: #ff1493,
        pink-kariert: #ff1493,
        powder-rose: #ff1493,
        rose: #ff1493,
        rosevintage: #ff1493,
        rose-melange: #ff1493,
        rot: #f00,
        rotvintage: #f00,
        rot-gestreift: #f00,
        rot-kariert: #f00,
        sand: #deb887,
        schwarz: #000,
        senf-gelb: #ff0,

        smaragdgruen: #228b22,
        streifenblau: #0000cd,
        streifenbraun: #8b4513,
        streifengruen: #228b22,
        streifennavy: #0000cd,
        streifenpink: #ff1493,
        streifenrot: #f00,
        streifenschwarz: #000,
        streifenweiss: #fffff0,
        taupe: #deb887,
        transparent: #fffff0,
        tuerkis: #40e0d0,
        weiss: #fffff0,
        weissvintage: #fffff0
) {
    .label-#{$label} {
        background: $value;
    }
}

1 个答案:

答案 0 :(得分:1)

颜色名称不是字符串,它们是颜色,并且与hex / rgb / rgba / hsl / hsla颜色声明的处理方式相同。等于#000080的颜色为navy。你有重复的海军钥匙。

将来,如果您希望映射的键是字符串,则应始终使用引号将它们强制为字符串。