Implement light theme

I also went ahead and fixed some buttonstyles that were inconsistent throughout the app
This commit is contained in:
William Brawner 2020-10-02 14:31:43 +00:00
parent 914f9a2a25
commit 90b886cce5
8 changed files with 144 additions and 93 deletions

View file

@ -1,11 +1,15 @@
mat-toolbar {
background-color: #fafafa;
box-shadow: none;
padding-left: 0.5em;
padding-right: 0.5em;
position: sticky;
top: 0;
z-index: 999999;
}
@media (prefers-color-scheme: dark) {
mat-toolbar {
background-color: #303030;
box-shadow: none;
padding-left: 0.5em;
padding-right: 0.5em;
position: sticky;
top: 0;
z-index: 999999;
}
}

View file

@ -9,6 +9,6 @@
<mat-form-field>
<textarea matInput [(ngModel)]="budget.description" placeholder="Description"></textarea>
</mat-form-field>
<button mat-button color="accent" (click)="save()">Save</button>
<button class="button-delete" mat-button color="warn" *ngIf="budget.id" (click)="delete()">Delete</button>
<button mat-raised-button color="accent" (click)="save()">Save</button>
<button class="button-delete" mat-raised-button color="warn" *ngIf="budget.id" (click)="delete()">Delete</button>
</div>

View file

@ -1,69 +1,90 @@
.dashboard {
color: #333333;
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 1em;
}
.dashboard>mat-card {
background: #FFFFFF;
display: inline-block;
margin: 1em;
padding: 1em;
max-width: 500px;
position: relative;
width: 100%;
align-self: flex-start;
}
.dashboard .dashboard-primary {
padding: 5em 1em;
text-align: center;
}
.dashboard-primary>* {
display: block;
}
.dashboard div h2,
.dashboard div h3 {
margin: 0;
}
.dashboard p,
.dashboard a {
color: #333333;
text-align: center;
text-decoration: none;
}
.dashboard-primary div {
bottom: 0.5em;
display: flex;
justify-content: flex-end;
left: 0.5em;
right: 0.5em;
position: absolute;
}
.dashboard .no-categories {
padding: 1em;
text-align: center;
}
.dashboard .no-categories a {
border-color: #333333;
display: inline-block;
border: 1px dashed;
padding: 1em;
}
.dashboard .no-categories p {
line-height: normal;
white-space: normal;
}
a.view-all {
position: absolute;
right: 0.5em;
top: 0.5em;
}
@media (prefers-color-scheme: dark) {
.dashboard {
color: #F1F1F1;
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 1em;
}
.dashboard > mat-card {
.dashboard>mat-card {
background: #212121;
display: inline-block;
margin: 1em;
padding: 1em;
max-width: 500px;
position: relative;
width: 100%;
align-self: flex-start;
}
.dashboard .dashboard-primary {
padding: 5em 1em;
text-align: center;
}
.dashboard-primary > * {
display: block;
}
.dashboard div h2, .dashboard div h3 {
margin: 0;
}
.dashboard p, .dashboard a {
.dashboard p,
.dashboard a {
color: #F1F1F1;
text-align: center;
text-decoration: none;
}
.dashboard-primary div {
bottom: 0.5em;
display: flex;
justify-content: flex-end;
left: 0.5em;
right: 0.5em;
position: absolute;
}
.dashboard .no-categories {
padding: 1em;
text-align: center;
}
.dashboard .no-categories a {
display: inline-block;
border: 1px dashed #F1F1F1;
padding: 1em;
border-color: #F1F1F1;
}
.dashboard .no-categories p {
line-height: normal;
white-space: normal;
}
a.view-all {
position: absolute;
right: 0.5em;
top: 0.5em;
}
}

View file

@ -18,6 +18,6 @@
<input type="color" matInput [(ngModel)]="currentCategory.color" placeholder="Color">
</mat-form-field>
-->
<button mat-button color="accent" (click)="save()">Save</button>
<button class="button-delete" mat-button color="warn" *ngIf="currentCategory.id" (click)="delete()">Delete</button>
<button mat-raised-button color="accent" (click)="save()">Save</button>
<button class="button-delete" mat-raised-button color="warn" *ngIf="currentCategory.id" (click)="delete()">Delete</button>
</div>

View file

@ -1,12 +1,7 @@
.categories mat-progress-bar.mat-progress-bar {
background-color: #BDBDBD;
margin-top: 0.5em;
}
::ng-deep .mat-progress-bar-buffer {
background-color: #BDBDBD;
}
p.mat-line.category-list-title {
display: flex;
justify-content: space-between;
@ -26,5 +21,11 @@ p.mat-line.category-list-title .remaining {
}
::ng-deep .mat-progress-bar-buffer {
background-color: #333333 !important;
background-color: #F1F1F1 !important;
}
@media (prefers-color-scheme: dark) {
::ng-deep .mat-progress-bar-buffer {
background-color: #333333 !important;
}
}

View file

@ -1,6 +1,5 @@
.transaction-form {
padding: 1em;
color: #F1F1F1;
}
.transaction-form * {
@ -10,8 +9,3 @@
mat-radio-button {
padding-bottom: 15px;
}
button {
width: 100%;
margin: 1em 0;
}

View file

@ -2,14 +2,14 @@
html,
body {
background: #333333;
background: #F1F1F1;
font-family: Roboto, "Helvetica Neue", sans-serif;
margin: 0;
padding: 0;
}
p {
color: #F1F1F1;
color: #333333;
margin: 0;
}
@ -21,7 +21,7 @@ a.mat-fab {
.text-small {
font-size: 1em;
color: #BDBDBD
color: #333333;
}
mat-toolbar.mat-toolbar-row,
@ -29,21 +29,21 @@ mat-toolbar.mat-toolbar-single-row {
padding: 0;
}
mat-toolbar > span {
mat-toolbar>span {
display: flex;
width: 33%;
;
}
mat-toolbar > span:nth-child(1) {
mat-toolbar>span:nth-child(1) {
justify-content: flex-start;
}
mat-toolbar > span:nth-child(2) {
mat-toolbar>span:nth-child(2) {
justify-content: center;
}
mat-toolbar > span:nth-child(3) {
mat-toolbar>span:nth-child(3) {
justify-content: flex-end;
}
@ -105,7 +105,7 @@ mat-sidenav {
.form {
padding: 1em;
color: #F1F1F1;
color: #333333;
}
.form .mat-form-field,
@ -115,4 +115,29 @@ mat-sidenav {
.form mat-radio-button {
padding-bottom: 15px;
}
.form button {
width: 100%;
margin: 1em 0;
}
@media (prefers-color-scheme: dark) {
html,
body {
background: #333333;
}
p {
color: #F1F1F1;
}
.text-small {
color: #BDBDBD;
}
.form {
color: #F1F1F1;
}
}

View file

@ -16,9 +16,15 @@ $budget-app-accent: mat-palette($mat-cyan);
$budget-app-warn: mat-palette($mat-red);
// Create the theme object (a Sass map containing all of the palettes).
$budget-app-theme: mat-dark-theme($budget-app-primary, $budget-app-accent, $budget-app-warn);
$budget-app-theme: mat-light-theme($budget-app-primary, $budget-app-accent, $budget-app-warn);
$budget-dark-theme: mat-dark-theme($budget-app-primary, $budget-app-accent, $budget-app-warn);
// Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
@include angular-material-theme($budget-app-theme);
@media (prefers-color-scheme: dark) {
@include angular-material-theme($budget-dark-theme);
}