2017-09-08 1 views
2

전체 스타일링을 손으로 다시 만들지 않고 각도 2 소재의 단추로 기본 색상이나 강조 색상의 더 밝고 어두운 색상을 사용하는 우아한 방법이 있습니까?각도 2 재질 버튼의 밝고 어두운 색상 사용

+0

https://material.angularjs.org/latest/api/directive/mdColors –

+0

현재 t 여기에는 제출 된 문제가 있지만 여기에는 그러한 기능이 없습니다. https://github.com/angular/material2/issues/6059 – Edric

답변

2

당신은 당신이 지금처럼하는 SCS 파일 및 대상 물질 색상에 재질 테마를 가져올 수 있습니다 말대꾸를 사용하는 경우 :

app.component.scss을

@import '[email protected]/material/theming'; 

.buttonPrimary { 
    background-color: mat-color($mat-purple, 200); 
} 

.buttonAccent { 
    background-color: mat-color($mat-amber, A200); 
} 

app.component.html

<button md-raised-button class="buttonPrimary">primary</button> 
<button md-raised-button class="buttonAccent">accent</button> 
+0

어떻게 내가 그 일을 끝내 었는지 알았지 만, 편의성 때문에 나는 더 가볍고 어두운 클래스로 끝났습니다. 기본 및 억양 모두를위한 작업과 다양한 유형의 버튼. 그러나 그것은 내가 한 일의 핵심입니다. –

관련 문제