|
1 | | -/** |
2 | | -* Generated theme by Material Theme Generator |
3 | | -* https://materialtheme.arcsine.dev |
4 | | -* Fork at: https://materialtheme.arcsine.dev/?c=YHBhbGV0dGU$YHByaW1hcnk$YF48IzRjN2MzYyIsIj9lcjwjYzlkOGM1IiwiO2VyPCMzMzVmMjd$LCIlPmBePCM0OTg0OTciLCI~ZXI8I2M4ZGFlMCIsIjtlcjwjMzE2Nzdhfiwid2Fybj5gXjwjZWY5YjAwIiwiP2VyPCNmYWUxYjMiLCI7ZXI8I2U4N2YwMH4sIj9UZXh0PCMwMDAwMDAiLCI~PTwjZmFmYWZhIiwiO1RleHQ8I2ZmZmZmZiIsIjs9PCMyYzJjMmN$LCJmb250cz5bYEA8KC00fixgQDwoLTN$LGBAPCgtMn4sYEA8KC0xfixgQDxoZWFkbGluZX4sYEA8dGl0bGV$LGBAPHN1YiktMn4sYEA8c3ViKS0xfixgQDxib2R5LTJ$LGBAPGJvZHktMX4sYEA8YnV0dG9ufixgQDxjYXB0aW9ufixgQDxpbnB1dCIsInNpemU$bnVsbH1dLCJpY29uczxGaWxsZWQiLCI~bmVzcz5mYWxzZSwidmVyc2lvbj4xM30= |
5 | | -*/ |
6 | | -@use "sass:map"; |
7 | | -@use "@angular/material/" as mat; |
| 1 | +@use '@angular/material' as mat; |
8 | 2 | @use "../../ng-mat-components" as fsc; |
9 | | - |
10 | | -// Include the common styles for Angular Material. We include this here so that you only |
11 | | -// have to load a single css file for Angular Material in your app. |
12 | | - |
13 | | -// fonts |
14 | | -// @import "material-icons/iconfont/material-icons.scss"; |
15 | | -// @import "@fontsource/roboto"; |
16 | | - |
17 | | -$fontConfig: ( |
18 | | - display-4: mat.define-typography-level(112px, 112px, 300, "Roboto", -0.0134em), |
19 | | - display-3: mat.define-typography-level(56px, 56px, 400, "Roboto", -0.0089em), |
20 | | - display-2: mat.define-typography-level(45px, 48px, 400, "Roboto", 0em), |
21 | | - display-1: mat.define-typography-level(34px, 40px, 400, "Roboto", 0.0074em), |
22 | | - headline: mat.define-typography-level(24px, 32px, 400, "Roboto", 0em), |
23 | | - title: mat.define-typography-level(20px, 32px, 500, "Roboto", 0.0075em), |
24 | | - subheading-2: mat.define-typography-level(16px, 28px, 400, "Roboto", 0.0094em), |
25 | | - subheading-1: mat.define-typography-level(15px, 24px, 500, "Roboto", 0.0067em), |
26 | | - body-2: mat.define-typography-level(14px, 24px, 500, "Roboto", 0.0179em), |
27 | | - body-1: mat.define-typography-level(14px, 20px, 400, "Roboto", 0.0179em), |
28 | | - button: mat.define-typography-level(14px, 14px, 500, "Roboto", 0.0893em), |
29 | | - caption: mat.define-typography-level(12px, 20px, 400, "Roboto", 0.0333em), |
30 | | - input: mat.define-typography-level(inherit, 1.125, 400, "Roboto", 1.5px), |
31 | | -); |
32 | | - |
33 | | -// Foreground Elements |
34 | | - |
35 | | -// Light Theme Text |
36 | | -$dark-text: #000000; |
37 | | -$dark-primary-text: rgba($dark-text, 0.87); |
38 | | -$dark-accent-text: rgba($dark-primary-text, 0.54); |
39 | | -$dark-disabled-text: rgba($dark-primary-text, 0.38); |
40 | | -$dark-dividers: rgba($dark-primary-text, 0.12); |
41 | | -$dark-focused: rgba($dark-primary-text, 0.12); |
42 | | - |
43 | | -$mat-light-theme-foreground: ( |
44 | | - base: black, |
45 | | - divider: $dark-dividers, |
46 | | - dividers: $dark-dividers, |
47 | | - disabled: $dark-disabled-text, |
48 | | - disabled-button: rgba($dark-text, 0.26), |
49 | | - disabled-text: $dark-disabled-text, |
50 | | - elevation: black, |
51 | | - secondary-text: $dark-accent-text, |
52 | | - hint-text: $dark-disabled-text, |
53 | | - accent-text: $dark-accent-text, |
54 | | - icon: $dark-accent-text, |
55 | | - icons: $dark-accent-text, |
56 | | - text: $dark-primary-text, |
57 | | - slider-min: $dark-primary-text, |
58 | | - slider-off: rgba($dark-text, 0.26), |
59 | | - slider-off-active: $dark-disabled-text, |
60 | | -); |
61 | | - |
62 | | -// Dark Theme text |
63 | | -$light-text: #ffffff; |
64 | | -$light-primary-text: $light-text; |
65 | | -$light-accent-text: rgba($light-primary-text, 0.7); |
66 | | -$light-disabled-text: rgba($light-primary-text, 0.5); |
67 | | -$light-dividers: rgba($light-primary-text, 0.12); |
68 | | -$light-focused: rgba($light-primary-text, 0.12); |
69 | | - |
70 | | -$mat-dark-theme-foreground: ( |
71 | | - base: $light-text, |
72 | | - divider: $light-dividers, |
73 | | - dividers: $light-dividers, |
74 | | - disabled: $light-disabled-text, |
75 | | - disabled-button: rgba($light-text, 0.3), |
76 | | - disabled-text: $light-disabled-text, |
77 | | - elevation: black, |
78 | | - hint-text: $light-disabled-text, |
79 | | - secondary-text: $light-accent-text, |
80 | | - accent-text: $light-accent-text, |
81 | | - icon: $light-text, |
82 | | - icons: $light-text, |
83 | | - text: $light-text, |
84 | | - slider-min: $light-text, |
85 | | - slider-off: rgba($light-text, 0.3), |
86 | | - slider-off-active: rgba($light-text, 0.3), |
87 | | -); |
88 | | - |
89 | | -// Background config |
90 | | -// Light bg |
91 | | -$light-background: #fafafa; |
92 | | -$light-bg-darker-5: darken($light-background, 5%); |
93 | | -$light-bg-darker-10: darken($light-background, 10%); |
94 | | -$light-bg-darker-20: darken($light-background, 20%); |
95 | | -$light-bg-darker-30: darken($light-background, 30%); |
96 | | -$light-bg-lighter-5: lighten($light-background, 5%); |
97 | | -$dark-bg-tooltip: lighten(#2c2c2c, 20%); |
98 | | -$dark-bg-alpha-4: rgba(#2c2c2c, 0.04); |
99 | | -$dark-bg-alpha-12: rgba(#2c2c2c, 0.12); |
100 | | - |
101 | | -$mat-light-theme-background: ( |
102 | | - background: $light-background, |
103 | | - status-bar: $light-bg-darker-20, |
104 | | - app-bar: $light-bg-darker-5, |
105 | | - hover: $dark-bg-alpha-4, |
106 | | - card: $light-bg-lighter-5, |
107 | | - dialog: $light-bg-lighter-5, |
108 | | - tooltip: $dark-bg-tooltip, |
109 | | - disabled-button: $dark-bg-alpha-12, |
110 | | - raised-button: $light-bg-lighter-5, |
111 | | - focused-button: $dark-focused, |
112 | | - selected-button: $light-bg-darker-20, |
113 | | - selected-disabled-button: $light-bg-darker-30, |
114 | | - disabled-button-toggle: $light-bg-darker-10, |
115 | | - unselected-chip: $light-bg-darker-10, |
116 | | - disabled-list-option: $light-bg-darker-10, |
117 | | -); |
118 | | - |
119 | | -// Dark bg |
120 | | -$dark-background: #2c2c2c; |
121 | | -$dark-bg-lighter-5: lighten($dark-background, 5%); |
122 | | -$dark-bg-lighter-10: lighten($dark-background, 10%); |
123 | | -$dark-bg-lighter-20: lighten($dark-background, 20%); |
124 | | -$dark-bg-lighter-30: lighten($dark-background, 30%); |
125 | | -$light-bg-alpha-4: rgba(#fafafa, 0.04); |
126 | | -$light-bg-alpha-12: rgba(#fafafa, 0.12); |
127 | | - |
128 | | -// Background palette for dark themes. |
129 | | -$mat-dark-theme-background: ( |
130 | | - background: $dark-background, |
131 | | - status-bar: $dark-bg-lighter-20, |
132 | | - app-bar: $dark-bg-lighter-5, |
133 | | - hover: $light-bg-alpha-4, |
134 | | - card: $dark-bg-lighter-5, |
135 | | - dialog: $dark-bg-lighter-5, |
136 | | - tooltip: $dark-bg-lighter-20, |
137 | | - disabled-button: $light-bg-alpha-12, |
138 | | - raised-button: $dark-bg-lighter-5, |
139 | | - focused-button: $light-focused, |
140 | | - selected-button: $dark-bg-lighter-20, |
141 | | - selected-disabled-button: $dark-bg-lighter-30, |
142 | | - disabled-button-toggle: $dark-bg-lighter-10, |
143 | | - unselected-chip: $dark-bg-lighter-20, |
144 | | - disabled-list-option: $dark-bg-lighter-10, |
145 | | -); |
146 | | - |
147 | | -// Compute font config |
148 | | -@include mat.core($fontConfig); |
149 | | - |
150 | | -// Theme Config |
151 | | - |
152 | | -body { |
153 | | - --primary-color: #4c7c3c; |
154 | | - --primary-lighter-color: #c9d8c5; |
155 | | - --primary-darker-color: #335f27; |
156 | | - --text-primary-color: #{$light-primary-text}; |
157 | | - --text-primary-lighter-color: #{$dark-primary-text}; |
158 | | - --text-primary-darker-color: #{$light-primary-text}; |
159 | | -} |
160 | | - |
161 | | -$mat-primary: ( |
162 | | - main: #4c7c3c, |
163 | | - lighter: #c9d8c5, |
164 | | - darker: #335f27, |
165 | | - 200: #4c7c3c, |
166 | | - // For slide toggle, |
167 | | - contrast: (main: $light-primary-text, |
168 | | - lighter: $dark-primary-text, |
169 | | - darker: $light-primary-text, |
170 | | - ), |
171 | | -); |
172 | | -$theme-primary: mat.define-palette($mat-primary, main, lighter, darker); |
173 | | - |
174 | | -body { |
175 | | - --accent-color: #498497; |
176 | | - --accent-lighter-color: #c8dae0; |
177 | | - --accent-darker-color: #31677a; |
178 | | - --text-accent-color: #{$light-primary-text}; |
179 | | - --text-accent-lighter-color: #{$dark-primary-text}; |
180 | | - --text-accent-darker-color: #{$light-primary-text}; |
181 | | -} |
182 | | - |
183 | | -$mat-accent: ( |
184 | | - main: #498497, |
185 | | - lighter: #c8dae0, |
186 | | - darker: #31677a, |
187 | | - 200: #498497, |
188 | | - // For slide toggle, |
189 | | - contrast: (main: $light-primary-text, |
190 | | - lighter: $dark-primary-text, |
191 | | - darker: $light-primary-text, |
192 | | - ), |
193 | | -); |
194 | | -$theme-accent: mat.define-palette($mat-accent, main, lighter, darker); |
195 | | - |
196 | | -body { |
197 | | - --warn-color: #ef9b00; |
198 | | - --warn-lighter-color: #fae1b3; |
199 | | - --warn-darker-color: #e87f00; |
200 | | - --text-warn-color: #{$dark-primary-text}; |
201 | | - --text-warn-lighter-color: #{$dark-primary-text}; |
202 | | - --text-warn-darker-color: #{$dark-primary-text}; |
203 | | -} |
204 | | - |
205 | | -$mat-warn: ( |
206 | | - main: #ef9b00, |
207 | | - lighter: #fae1b3, |
208 | | - darker: #e87f00, |
209 | | - 200: #ef9b00, |
210 | | - // For slide toggle, |
211 | | - contrast: (main: $dark-primary-text, |
212 | | - lighter: $dark-primary-text, |
213 | | - darker: $dark-primary-text, |
214 | | - ), |
215 | | -); |
216 | | -$theme-warn: mat.define-palette($mat-warn, main, lighter, darker); |
217 | | -$theme: ( |
218 | | - primary: $theme-primary, |
219 | | - accent: $theme-accent, |
220 | | - warn: $theme-warn, |
221 | | - is-dark: true, |
222 | | - foreground: $mat-dark-theme-foreground, |
223 | | - background: $mat-dark-theme-background, |
224 | | -); |
225 | | -$altTheme: ( |
226 | | - primary: $theme-primary, |
227 | | - accent: $theme-accent, |
228 | | - warn: $theme-warn, |
229 | | - is-dark: false, |
230 | | - foreground: $mat-light-theme-foreground, |
231 | | - background: $mat-light-theme-background, |
232 | | -); |
233 | | - |
234 | | -// Specific component overrides, pieces that are not in line with the general theming |
235 | | - |
236 | | -// Handle buttons appropriately, with respect to line-height |
237 | | -.mat-raised-button, |
238 | | -.mat-stroked-button, |
239 | | -.mat-flat-button { |
240 | | - padding: 0 1.15em; |
241 | | - margin: 0 0.65em; |
242 | | - min-width: 3em; |
243 | | - line-height: 36.4px; |
244 | | -} |
245 | | - |
246 | | -.mat-standard-chip { |
247 | | - padding: 0.5em 0.85em; |
248 | | - min-height: 2.5em; |
249 | | -} |
250 | | - |
251 | | -.material-icons { |
252 | | - font-size: 24px; |
253 | | - font-family: "Material Icons", "Material Icons"; |
254 | | - |
255 | | - .mat-badge-content { |
256 | | - font-family: "Roboto"; |
257 | | - } |
258 | | -} |
259 | | - |
260 | | -$background: map.get($theme, "background"); |
261 | | -$foreground: map.get($theme, "foreground"); |
262 | | - |
263 | | -@media (prefers-color-scheme: dark) { |
264 | | - @include mat.all-component-themes($theme); |
265 | | - @include fsc.all-component-themes($theme); |
266 | | - $background: map.get($theme, "background"); |
267 | | - $foreground: map.get($theme, "foreground"); |
268 | | -} |
269 | | - |
| 3 | +@use "./palettes"; |
| 4 | + |
| 5 | +@include mat.core(); |
| 6 | + |
| 7 | +// Define a dark theme |
| 8 | +$dark-theme: mat.define-dark-theme((color: (primary: mat.define-palette(palettes.$md-primary), |
| 9 | + accent: mat.define-palette(palettes.$md-accent), |
| 10 | + ), |
| 11 | + // Only include `typography` and `density` in the default dark theme. |
| 12 | + typography: mat.define-typography-config(), |
| 13 | + density: 0, |
| 14 | + )); |
| 15 | + |
| 16 | +// Define a light theme |
| 17 | +$light-theme: mat.define-light-theme((color: (primary: mat.define-palette(palettes.$md-primary), |
| 18 | + accent: mat.define-palette(palettes.$md-accent), |
| 19 | + ), |
| 20 | + )); |
| 21 | + |
| 22 | +// Apply the dark theme by default |
| 23 | +@include mat.all-component-themes($dark-theme); |
| 24 | +@include fsc.all-component-themes($dark-theme); |
| 25 | + |
| 26 | +// Apply the light theme only when the user prefers light themes. |
270 | 27 | @media (prefers-color-scheme: light) { |
271 | | - @include mat.all-component-themes($altTheme); |
272 | | - @include fsc.all-component-themes($altTheme); |
273 | | - $background: map.get($altTheme, "background"); |
274 | | - $foreground: map.get($altTheme, "foreground"); |
| 28 | + // Use the `-color` mixins to only apply color styles without reapplying the same |
| 29 | + // typography and density styles. |
| 30 | + @include mat.all-component-themes($light-theme); |
| 31 | + @include fsc.all-component-themes($light-theme); |
275 | 32 | } |
276 | 33 |
|
277 | 34 | @tailwind components; |
|
0 commit comments