각도 프로젝트의 CSS 파일에 각도 재료 테마에 사용 된 기본 색상을 검색하는 방법이 있습니까? 프로젝트에서 프로젝트의 스타일 시트에서 기본 색상 검색
, 우리는이 같은 * .scss 파일에 기본 색상을 정의 할 수 있습니다 : 내 구성 요소 * .scss 파일을 사용하려고@import '[email protected]/material/theming';
@include mat-core();
$primary: mat-palette($mat-green, 800);
$accent: mat-palette($mat-teal, 600, A100, A400);
$warn: mat-palette($mat-red, 600);
$theme: mat-light-theme($primary, $accent, $warn);
@include angular-material-theme($theme);
하지만 $primary
변수는 인식이었다
//*.scss file
//...
.myclass {
background: $primary; //This line compiles with the error 'Undefined variable: "$primary".'
}
를 사용하려면; $ mat-green = 녹색 (500) 및 800 = 녹색 (800); 그래서 당신은 그것을 그렇게 사용할 수 없습니다; https://github.com/angular/material2/issues/1393 – ShadowFoOrm