9
9
10
10
// the u-hue value is the main color of the style
11
11
$u-hue : 220deg ;
12
- $u-background : #d4d6da ;
13
- $u-background-darkmode : #111111 ;
14
- $u-text : #111111 ; // any text
15
- $u-text-darkmode : #eeeeee ; // any text
16
12
17
13
$u-primary : hsl ($u-hue 80% 30% ); // active objects
18
14
$u-primary-text : white ;
@@ -21,12 +17,8 @@ $u-border-color: #555555;
21
17
$u-border-color-active : hsl ($u-hue 100% 30% );
22
18
23
19
$u-disabled : gray ; // disabled objects
24
- $u-heading : $u-primary ; // any headlines
25
20
$u-connect : #00cc00 ; // connectivity / net
26
21
27
- $u-on : color .scale (green , $lightness : 10% );
28
- $u-off : red ;
29
-
30
22
$u-padding-text : 4px ;
31
23
$u-padding-block : calc (2 * $u-padding-text );
32
24
@@ -36,7 +28,6 @@ $u-border-none: $u-border-size solid transparent;
36
28
$u-border-active : $u-border-size solid $u-border-color-active ;
37
29
38
30
39
-
40
31
// ===== Content Box Sizes =====
41
32
42
33
$u-white-space : 1rem ;
@@ -57,17 +48,30 @@ $u-font-sans-serif: arial, ui-sans-serif, sans-serif;
57
48
// ===== main =====
58
49
59
50
:root {
60
- --color : #{$u-text } ;
61
- --back : #{$u-background } ;
62
- --focus : #{hsl ($u-hue , 50% , 50% )} ;
63
- --text-spacing : #{$u-text-spacing } ;
51
+ color-scheme : light dark ;
52
+
53
+ // standard colors used for <html>
54
+ --back : light-dark (hsl (#{$u-hue } 2% 85% ), hsl (#{$u-hue } 2% 15% ));
55
+ --color : light-dark (hsl (#{$u-hue } 0 10% ), hsl (#{$u-hue } 0 90% ));
56
+
57
+ --success-hue : 80deg ;
58
+ --success-back : hsl (var (--success-hue ) 90% 75% );
59
+ --success-line : hsl (var (--success-hue ) 90% 40% );
60
+
61
+ --warning-hue : 40deg ;
62
+ --warning-back : hsl (var (--warning-hue ) 90% 75% );
63
+ --warning-line : hsl (var (--warning-hue ) 90% 40% );
64
+ --warning-color : black ;
65
+
66
+ --error-hue : 0deg ;
67
+ --error-back : hsl (var (--error-hue ) 90% 75% );
68
+ --error-line : hsl (var (--error-hue ) 90% 40% );
69
+ --error-color : color ;
64
70
65
- color-scheme : dark light ;
71
+ --focus : #{ hsl ( $u-hue , 50 % , 50 % )} ;
66
72
67
- @media (prefers-color-scheme : dark ) {
68
- --color : #{$u-text-darkmode } ;
69
- --back : #{$u-background-darkmode } ;
70
- }
73
+ --text-spacing : #{$u-text-spacing } ;
74
+ --transition : 0.3s ease ;
71
75
}
72
76
73
77
html ,
@@ -76,19 +80,12 @@ body {
76
80
margin : 0 ;
77
81
padding : 0 ;
78
82
font-family : $u-font-sans-serif ;
79
- font-size : 1em ;
83
+ font-size : 1rem ;
84
+ line-height : 1.2rem ;
80
85
color : var (--color );
81
86
background-color : var (--back );
82
87
}
83
88
84
-
85
-
86
- @media (width > 800px ) {
87
- body {
88
- padding : 2 * $u-padding-text ;
89
- }
90
- }
91
-
92
89
// apply a natural box layout model to all elements, but allowing components to change
93
90
* ,
94
91
* ::before ,
@@ -101,6 +98,13 @@ img {
101
98
height : auto ;
102
99
}
103
100
101
+ a ,
102
+ a :any-link {
103
+ color : inherit ;
104
+ text-decoration : underline ;
105
+ cursor : pointer ;
106
+ }
107
+
104
108
// use-cases of svg icons
105
109
106
110
svg {
@@ -127,75 +131,11 @@ svg {
127
131
}
128
132
129
133
130
- // ===== Text containers =====
131
- p ,
132
- pre ,
133
- h1 ,
134
- h2 ,
135
- h3 ,
136
- h4 ,
137
- .text {
138
- margin : 0 ;
139
- min-height : 1rem ;
140
-
141
- >img ,
142
- >svg {
143
- // assume image in text containers to be inline icons
144
- height : 1em ;
145
- height : auto ;
146
-
147
- & :first-child {
148
- margin-right : 0.2em ;
149
- }
150
- }
151
- }
152
-
153
- p :not (:first-child ),
154
- pre :not (:first-child ),
155
- .text :not (:first-child ) {
156
- margin-top : var (--text-spacing );
157
- }
158
-
159
- h1 :not (:first-child ),
160
- h2 :not (:first-child ),
161
- h3 :not (:first-child ),
162
- h4 :not (:first-child ) {
163
- margin-top : calc (var (--text-spacing ) * 3 );
134
+ // Title us used everywhere
135
+ h1 {
136
+ font-size : 2em ;
164
137
}
165
138
166
- a ,
167
- a :any-link {
168
- color : inherit ;
169
- text-decoration : underline ;
170
- cursor : pointer ;
171
- }
172
-
173
- h1 ,
174
- h2 ,
175
- h3 ,
176
- h4 {
177
- text-wrap : balance ;
178
- font-family : $u-font-sans-serif ;
179
- font-weight : bold ;
180
- }
181
-
182
- // Chapter
183
- h2 {
184
- font-size : 1.6em ;
185
- min-height : 1.6em ;
186
- }
187
-
188
- // Topic
189
- h3 {
190
- font-size : 1.25em ;
191
- min-height : 1.25em ;
192
- }
193
-
194
- // Subtitle
195
- h4 {
196
- font-size : 1em ;
197
- min-height : 1em ;
198
- }
199
139
200
140
201
141
// form elements
@@ -304,18 +244,28 @@ dialog {
304
244
}
305
245
}
306
246
307
- .error ,
308
- .warning ,
247
+ .warning {
248
+ border : 2px solid var (--warning-line );
249
+ background-color : var (--warning-back );
250
+ color : var (--warning-color );
251
+ }
252
+
253
+ .error {
254
+ border : 2px solid var (--error-line );
255
+ background-color : var (--error-back );
256
+ color : var (--error-color );
257
+ }
258
+
309
259
.invalid {
310
260
border : 2px solid #ff1111 !important ;
311
261
background-color : #ffcccc !important ;
312
- color : $u-text ;
262
+ color : var ( --color ) ;
313
263
}
314
264
315
265
.valid {
316
266
border : 2px solid #00cc00 !important ;
317
267
background-color : #ccffcc !important ;
318
- color : $u-text ;
268
+ color : var ( --color ) ;
319
269
}
320
270
321
271
.noprint {
0 commit comments