2016-08-30 1 views
0

Следующий scss mixin с ошибкой компиляции
Недопустимый CSS после "... (base, $ base)": expected ")", was ";" Не удалось найти ошибку, пожалуйста, помогитеscss Mixins error

// Variables for Materiel colours 
$primary   : #0293FF; 
$primary-dark : darken($primary,25%); 
$primary-light : lighten($primary,75%); 
$accent   : #FF5252; 

$text   : #ffffff; 
$primary-text : #333333; 
$secondary-text : #727272; 
$divider   : #B6B6B6; 
$base   : #FAFAFA; 

$palette: (primary, $primary), 
      (primary-dark, $primary-dark), 
      (primary-light, $primary-light), 
      (text, $text), 
      (primary-text, $primary-text, 
      (secondary-text, $secondary-text), 
      (accent, $accent), 
      (divider, $divider), 
      (base, $base); 

@each $palette , $color in $palette { 
    .colour-#{$palette } { 
    color: $color; 
    } 
    .bg-#{$palette } { 
    background-color: $color; 
    } 
} 

ответ

1

Вы не закрывающая скобки после $ первичного текста?

$palette: (primary, $primary), 
      (primary-dark, $primary-dark), 
      (primary-light, $primary-light), 
      (text, $text), 
      (primary-text, $primary-text), 
      (secondary-text, $secondary-text), 
      (accent, $accent), 
      (divider, $divider), 
      (base, $base); 
0

Если вы хотите использовать VARS карту, Вы должны написать, как это "key_name": $ значение

// Variables for Materiel colours 
$primary   : #0293FF; 
$primary-dark : darken($primary,25%); 
$primary-light : lighten($primary,75%); 
$accent   : #FF5252; 

$text   : #ffffff; 
$primary-text : #333333; 
$secondary-text : #727272; 
$divider   : #B6B6B6; 
$base   : #FAFAFA; 

$palette:(
     "primary": $primary, 
     "primary-dark": $primary-dark, 
     "primary-light": $primary-light, 
     "text": $text, 
     "primary-text": $primary-text, 
     "secondary-text": $secondary-text, 
     "accent": $accent, 
     "divider": $divider, 
     "base": $base 
); 


@each $palette , $color in $palette { 
    .colour-#{$palette} { 
    color: $color; 
    } 
    .bg-#{$palette} { 
    background-color: $color; 
    } 
} 

Привет :)

+0

спасибо за ваше предложение. – user1292594