Skip to content

Commit

Permalink
#20 Angular Material theme customised instead of adding custom styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ofcyln committed May 15, 2020
1 parent 3c93a5e commit 1de7579
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
6 changes: 4 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.scss"
"src/styles.scss",
"src/assets/scss/theme.scss"
],
"scripts": []
},
Expand Down Expand Up @@ -98,7 +99,8 @@
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.scss"
"src/styles.scss",
"src/assets/scss/theme.scss"
],
"scripts": []
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/calculate/results/results.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
<mat-checkbox *ngIf="expenseItem.specialExpense; else nameField"
[disabled]="expenseItem.exceededAmount"
(change)="updateExpenseItemCheckedState()"
[(ngModel)]="expenseItem.checked">
[(ngModel)]="expenseItem.checked"
color="primary">
<p [ngStyle.lt-md]="{'font-weight': '500'}"
[ngClass.lt-md]="'margin-top-sm'"
class="margin-bottom-zero">
Expand Down
9 changes: 9 additions & 0 deletions src/assets/scss/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '~@angular/material/theming';
@include mat-core();

$my-app-primary: mat-palette($mat-deep-purple);
$my-app-accent: mat-palette($mat-red);
$my-app-warn: mat-palette($mat-amber);
$my-app-theme: mat-light-theme($my-app-primary, $my-app-accent, $my-app-warn);

@include angular-material-theme($my-app-theme);
9 changes: 0 additions & 9 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,3 @@ body {
font-size: 18px !important;
}

.mat-checkbox-checked:not(.mat-checkbox-disabled).mat-accent .mat-ripple-element,
.mat-checkbox:active:not(.mat-checkbox-disabled).mat-accent .mat-ripple-element {
background: #673bb7;
}

.mat-checkbox-indeterminate.mat-accent .mat-checkbox-background,
.mat-checkbox-checked.mat-accent .mat-checkbox-background {
background-color: #673bb7;
}

0 comments on commit 1de7579

Please sign in to comment.