-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHUI_theme.css
More file actions
299 lines (223 loc) · 9.45 KB
/
HUI_theme.css
File metadata and controls
299 lines (223 loc) · 9.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
R"htuijsstr(
/*
This file is example and default HUI theme.
Keep in mind that styling can affect performace if a lot of graphic effects (animations, transparency, images) are used.
Apps are not required to apply the styles - apps may only use the defined colors and use own UI.
*/
@charset "utf-8";
:root {
/******************** HUI styling variables ********************/
--hui_var_language: "en"; /* ISO 639-1 (en) or IETF BCP 47 (en-US) */
--hui_var_theme_style: "dark"; /* dark/light */
/* TODO: multiple languages (preference list) */
/* TODO: language string parser and text replace based translate */
/* TODO: transparency enable/disable (may help performace), vibrancy/background blur (will need some help from backend/window manager configuration) */
/* NOTE: to config window decorations, use config for your WM (we dont support client-side-decorations, only server-side-decorations) */
--hui_style_theme_color: white; /* color, used in CSS color-mix(in srgb, var(--hui_style_theme_color) 75%, {black or white} 25%) */
--hui_style_text_font: "Consolas", monospace; /* font-family */
--hui_style_text_color: rgba(250,250,250,1); /* color */
--hui_style_text_scale: 1.0; /* float number, multiplies the default size, like calc( {size} * var(--hui_style_text_scale) ) */
--hui_style_elements_scale: 1.0; /* float number, multiplies the default size, like calc( {size} * var(--hui_style_elements_scale) ) */
--hui_style_elements_color: rgba(53,53,53,1);
--hui_style_background_color: rgba(23,23,23,0.85);
--hui_style_background_secondary_color: rgba(23,23,23,0.85);
/* NOTE: hover/focus color wouldnt reliably work because sometimes the effect is for example border style and not a color */
/* TODO: rounded corners - bool or value; may be dificuilt to set/use (this is not something that dev doing custom ui will want) */
/* TODO: selected text highlight - hard to set, cos its style not a color - maybe can be set globally */
/* TODO: background area, elements, div area = secondary background -- should these be of type color or background */
/***************************************************************/
/* just variables for this stylesheet */
--hui_color_background: rgba(23,23,23,0.85);
--hui_color_elements: rgba(53,53,53,1);
--hui_color_text: rgba(250,250,250,1);
--hui_font: var(--hui_style_text_font);
/*
--hui_ronded 1px;
--hui_color_text
--hui_color_area
--hui_color_elements
*/
}
/* font from data url */
/*@font-face {
font-family: --hui_style_text_font;
src: url(data:@file/x-font-ttf;base64,...);
}
:root {
...
--hui_style_text_font: --hui_style_text_font;
...
}
*/
/******************** HUI styling styles ********************/
/************************************************************/
.hui_unstyled {}
.hui_styled {}
.hui_translate {}
.hui_scrollable {}
.hui_zoomable {}
/* p, div and span elements should be kept as they are */
/* --- TEXT ELEMENTS --- */
*:not(.hui_unstyled) {
font-family: var(--hui_font);
}
body:not(.hui_unstyled) {
background-color: var(--hui_color_background);
color: var(--hui_color_text);
font-size: 15px;
}
p:not(.hui_unstyled) {
}
a:not(.hui_unstyled) {
font-style: italic;
text-decoration: underline;
}
/* --- TEXT INPUT ELEMENTS --- */
button:not(.hui_unstyled), input:not(.hui_unstyled), select:not(.hui_unstyled), textarea:not(.hui_unstyled) {
background-color: var(--hui_color_elements);
color: var(--hui_color_text);
border: none;
border-radius: 2px;
height: 35px;
min-width: 80px;
text-indent: 3px;
box-sizing: border-box; /* fixes different sizes of text/number inputs vs. button and button input and select with same css height set */
}
button:not(.hui_unstyled), input[type=button]:not(.hui_unstyled) {
text-indent: unset;
padding: 0 15px;
border: 2px solid rgba(0,0,0,0) !important; /* fix moving layout on focus */
}
select:not(.hui_unstyled) {
-webkit-appearance: none; /* fixes not applying background color under webkit2 but removes arrow */
background: var(--hui_color_elements) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" fill="none" stroke="rgba(250,250,250,1)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15l6 6 6-6"/></svg>') no-repeat 100% 50%;
padding-right: 32px;
min-width: 112px; /* fixes width not matching text/number input elements */
}
input:not(.hui_unstyled), select:not(.hui_unstyled), *[contenteditable]:not(.hui_unstyled, td, th) { /* fixes moving layout on focus */
border-bottom: 2px solid rgba(0,0,0,0) !important;
}
input[type=number] {
/* -moz-appearance: textfield; */ /* removes default ugly +/- arrows */
/* appearance: textfield; */ /* removes default ugly +/- arrows */
/* TODO: +/- in gecko/servo - may need some help from js (clickable corners) - maybe it would be better to do this trough shaddow root (for all eolements: number input, select, text datalist, ...) */
background: var(--hui_color_elements) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -3 50 50" fill="none" stroke="rgba(250,250,250,1)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M30 15 H40 M35 10 V20" /> <path d="M30 35 H40" /></svg>') no-repeat 100% 50%;
}
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button {
/*-webkit-appearance: none;*/ /* removes default ugly +/- arrows */
opacity:0;
margin:0;
padding:0;
height: 100px;
}
input:focus-visible, select:focus-visible, *[contenteditable]:focus-visible, textarea:focus-visible { /* custom focus styling */
outline: none;
border-bottom: 2px solid var(--hui_color_text) !important;
}
button:focus-visible, input[type=button]:focus-visible, input[type=range]:focus-visible /*, *[tabindex]:focus-visible, a:focus-visible, *[onclick]:focus-visible*/ { /* custom focus styling */
outline: none;
border: 2px solid var(--hui_color_text) !important;
}
fieldset {
border: 2px solid var(--hui_color_elements);
border-radius: 2px;
}
/* --- OTHER ELEMENTS --- */
input[type="radio"] {
appearance: none;
min-width: unset;
width: 20px;
height: 20px;
/*border: 2px solid var(--hui_color_text);*/
border-radius: 50%;
cursor: pointer;
border: 2px solid var(--hui_color_elements) !important; /* fix moving layout on focus */
}
input[type="radio"]:checked {
appearance: none;
min-width: unset;
width: 20px;
height: 20px;
/*border: 2px solid rgba(0,0,0,0);*/
border-radius: 50%;
cursor: pointer;
background-color: var(--hui_color_text);
}
input[type=radio]:focus-visible {
box-shadow: 0 0 0 2px var(--hui_color_text);
}
input[type="checkbox"] {
appearance: none;
width: 20px;
height: 20px;
min-width: unset;
border-radius: 2px;
cursor: pointer;
}
input[type="checkbox"]:checked::after {
content: "✔";
color: var(--hui_color_text);
font-size: 13px;
position: relative;
top: 1px;
left: 2px;
}
input[type="range"] {
min-width: 100px;
height: 10px;
background: var(--hui_color_elements);
border-radius: 5px;
outline: none;
-webkit-appearance: none;
border: 2px solid rgba(0,0,0,0) !important; /* fix moving layout on focus */
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 15px;
height: 25px;
cursor: pointer;
border-radius: 2px;
background: var(--hui_color_text);
}
input[type="range"]::-moz-range-thumb {
width: 15px;
height: 25px;
cursor: pointer;
border-radius: 2px;
background: var(--hui_color_text);
}
textarea:not(.hui_unstyled) {
text-indent: 3px each-line; /* TODO: each-line not supported in chromium */
}
/* --- COMMON FOR ALL ELEMENTS --- */
*:disabled {
filter: blur(0.9px);
}
/* TODO: hover effect done with opacity */
/* TODO: animations */
/* TODO: fractional scaling */
/* TODO: focus on tabindex with dot overlay */
/* TODO: user style javascript (but keep it safe) - now one can recompile HUI with hui.js edited */
/* TODO: scrollable/zoomable area (div) + style scrollbars -> .hui_app vs. .hui_scrollable */
/* TODO: research new ideas: <https://blogs.windows.com/msedgedev/2022/05/05/styling-select-elements-for-real/> <https://open-ui.org> */
/* TODO: move rules to HUI-styling */
/* TODO:
?tables (extended)
file input (text input with browse button? + window)
time inputs (universal for all types of times/dates/ranges => popup)
color input (window?)
input type password (same as text input)
*/
/*
TODO: THINK ABOUT:
changes to html standard:
spinbuttons of inputs - <button><spinbutton/></button>
input type select - input elements can be called either <input type="text"> or <text> --types: text, number, select, switch, button, checkbox, ?composite --value is content, inner html is for (spin)buttons / datalist --spinbutton usage: value-inc, value-dec, value-rst, value-rm, value-sel, value-hint, value-submit
dont change layout due to border changes (?solved -> box-sizing/transparent border/?outline)
solve CSS3 standard: content: "text" normal element vs pseudo ::before/after -> hui translate/... <https://github.com/w3c/csswg-drafts/issues/2889>
rules:
use tabindex so apps are keyboard accesible
use title for text/llm accassibility --- acessibility: html title atribute for voice/ai control <https://stackoverflow.com/questions/7503183/what-is-the-easiest-way-to-create-an-html-mouseover-tool-tip>, all interactable elements should be focusable, review keyboard/mouse actions on inputs, touch should work well too
*/
)htuijsstr"