Skip to content

Commit b1fccce

Browse files
authored
Fix dark theme at serval-administration (#3511)
1 parent 0e90a94 commit b1fccce

File tree

6 files changed

+48
-9
lines changed

6 files changed

+48
-9
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@use '@angular/material' as mat;
2+
3+
@mixin color($theme) {
4+
$is-dark: mat.get-theme-type($theme) == dark;
5+
6+
--sf-draft-jobs-table-row-background: #{mat.get-theme-color($theme, neutral, if($is-dark, 10, 100))};
7+
--sf-draft-jobs-project-link-color: #{mat.get-theme-color($theme, primary, if($is-dark, 70, 40))};
8+
--sf-draft-jobs-book-count-color: #{mat.get-theme-color($theme, neutral, if($is-dark, 70, 40))};
9+
}
10+
11+
@mixin theme($theme) {
12+
@if mat.theme-has($theme, color) {
13+
@include color($theme);
14+
}
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@use '@angular/material' as mat;
2+
3+
@mixin color($theme) {
4+
$is-dark: mat.get-theme-type($theme) == dark;
5+
6+
--sf-job-events-summary-background: #{mat.get-theme-color($theme, neutral, if($is-dark, 20, 95))};
7+
--sf-job-events-item-border-color: #{mat.get-theme-color($theme, neutral, if($is-dark, 40, 90))};
8+
--sf-job-events-exception-background: #{mat.get-theme-color($theme, error, if($is-dark, 20, 95))};
9+
--sf-job-events-exception-border-color: #{mat.get-theme-color($theme, error, if($is-dark, 40, 80))};
10+
--sf-job-events-payload-background: #{mat.get-theme-color($theme, neutral, if($is-dark, 17, 98))};
11+
--sf-job-events-payload-border-color: #{mat.get-theme-color($theme, neutral, if($is-dark, 40, 90))};
12+
}
13+
14+
@mixin theme($theme) {
15+
@if mat.theme-has($theme, color) {
16+
@include color($theme);
17+
}
18+
}

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/draft-jobs.component.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77

88
#draft-jobs-table tr:nth-child(odd) {
9-
background-color: white;
9+
background-color: var(--sf-draft-jobs-table-row-background);
1010
}
1111

1212
app-owner,
@@ -76,7 +76,7 @@ app-owner,
7676
}
7777

7878
.project-link {
79-
color: #1976d2;
79+
color: var(--sf-draft-jobs-project-link-color);
8080
text-decoration: none;
8181
font-weight: 500;
8282

@@ -89,7 +89,7 @@ app-owner,
8989
cursor: help;
9090
text-decoration: underline;
9191
text-decoration-style: dotted;
92-
color: #666;
92+
color: var(--sf-draft-jobs-book-count-color);
9393
}
9494

9595
.filter-notice-content {

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/job-events-dialog.component.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77

88
.job-summary {
9-
background: #f5f5f5;
9+
background: var(--sf-job-events-summary-background);
1010
padding: 16px;
1111
border-radius: 4px;
1212
margin-bottom: 20px;
@@ -18,7 +18,7 @@
1818

1919
.events-timeline {
2020
.event-item {
21-
border: 1px solid #e0e0e0;
21+
border: 1px solid var(--sf-job-events-item-border-color);
2222
border-radius: 8px;
2323
margin-bottom: 16px;
2424
padding: 16px;
@@ -68,8 +68,8 @@
6868
}
6969

7070
.event-exception {
71-
background: #ffebee;
72-
border: 1px solid #ffcdd2;
71+
background: var(--sf-job-events-exception-background);
72+
border: 1px solid var(--sf-job-events-exception-border-color);
7373
border-radius: 4px;
7474
padding: 12px;
7575
margin-bottom: 8px;
@@ -88,8 +88,8 @@
8888

8989
.event-payload,
9090
.event-result {
91-
background: #f9f9f9;
92-
border: 1px solid #e0e0e0;
91+
background: var(--sf-job-events-payload-background);
92+
border: 1px solid var(--sf-job-events-payload-border-color);
9393
border-radius: 4px;
9494
padding: 12px;
9595
margin-bottom: 8px;

src/SIL.XForge.Scripture/ClientApp/src/app/shared/notice/notice.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ $colors: (
138138
// set the button theme vars to our specific colors
139139
--mdc-filled-button-container-color: var(--notice-color-button-bg);
140140
--mdc-filled-button-label-text-color: var(--notice-color-button-text);
141+
// icon buttons
142+
color: var(--notice-color-text);
141143

142144
&:hover {
143145
background-color: var(--notice-color-button-hover-bg) !important;

src/SIL.XForge.Scripture/ClientApp/src/material-styles.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
@use 'src/app/translate/biblical-terms/biblical-terms-theme' as sf-biblical-terms;
2424
@use 'src/app/translate/translate-overview/translate-overview.component' as sf-translate-overview;
2525
@use 'src/app/permissions-viewer/permissions-viewer-theme' as sf-permissions-viewer;
26+
@use 'src/app/serval-administration/draft-jobs-theme' as sf-draft-jobs;
27+
@use 'src/app/serval-administration/job-events-dialog-theme' as sf-job-events-dialog;
2628

2729
@use 'text' as sf-text;
2830

@@ -55,6 +57,8 @@
5557
@include sf-text.theme($theme);
5658
@include sf-translate-overview.theme($theme);
5759
@include sf-permissions-viewer.theme($theme);
60+
@include sf-draft-jobs.theme($theme);
61+
@include sf-job-events-dialog.theme($theme);
5862

5963
// Custom variables
6064
--sf-disabled-foreground: #{mat.get-theme-color($theme, neutral, 70)};

0 commit comments

Comments
 (0)