2015-12-11 22 views
0

我使用了ember 2.2和ember-cli-materialize組件。 我的問題是,在app/styles/app.scss中,我可以定義$ primary-color,但所有其他值都被忽略(如$ accent-color或$ secondary-text-color)。如何在ember-cli-materialize中定義secondary-&accent-color?

這裏是我的app.scss:

@import 'components/color'; 

$primary-color-dark: #212121; 
$primary-color:  #212121; // only this line works 
$primary-color-light: #212121; 
$accent-color:   #ff6f00; 
$primary-text-color: #ff6f00; 
$secondary-text-color: #ff6f00; 
$divider-color:  #B6B6B6; 

@import 'components/variables'; 
@import 'materialize'; 
@import 'ember-cli-materialize'; 
+0

你從哪裏得到這樣的變量名?在物化css中我找不到'accent-color'變量,但是你試圖在這裏覆蓋它。 –

+0

是的,這是真的......我在實際文件中看到了這一點。他們似乎改變了一些變數。 –

回答

0

你有東西在你的SASS文件的順序是正確的。如果您導航到以下地址,則可以找到可覆蓋的變量列表:

bower_components/materialize/sass/components/_variables.scss 
+0

應該直接在_variables.scss中編輯它們嗎? –

+0

不,你是正確的做你的app.scss文件 – LukeC

+0

所以你的意思是我使用了錯誤的變量? –

0

你需要的components/color進口之前定義的變量:

$primary-color-dark: #212121; 
$primary-color:  #212121; // only this line works 
$primary-color-light: #212121; 
$accent-color:   #ff6f00; 
$primary-text-color: #ff6f00; 
$secondary-text-color: #ff6f00; 
$divider-color:  #B6B6B6; 

@import 'components/color'; 
@import 'components/variables'; 
@import 'materialize'; 
@import 'ember-cli-materialize'; 
+0

除非設置變量中的「組件/顏色」實際發生了變化,否則您建議的順序不會改變任何內容。請注意,文檔特別說明了它已經完成OP的方式:https://www.npmjs.com/package/ember-cli-materialize – cimmanon

+0

這不工作。我已經閱讀過文檔,並且像他們說的那樣完成了它。 –

相關問題