summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-librespeed/htdocs/luci-static/resources/librespeed/librespeed.css
blob: 75b1f0de60afd2849d21485f7d4850ac7195dc46 (plain)
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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
/* The theme's accent where the theme publishes one: --primary-color-medium
 * exists only in luci-theme-bootstrap. Every other in-tree theme sees the
 * fallback, which must clear 3:1 against a light page -- the arc and the
 * history line are the only graphical encoding of the data. */
:root {
	--librespeed-accent: var(--primary-color-medium, #3c8dbc);
}

/* Dark is an attribute in LuCI, not a media preference: bootstrap stamps
 * data-darkmode on the root and pins it for its light/dark variants, while
 * the themes that actually reach the fallback have no dark mode at all --
 * an OS-level preference must not darken their light pages. */
:root[data-darkmode="true"] {
	--librespeed-accent: var(--primary-color-medium, #6ab0de);
}

/* The one piece of CSS this application owns: layout and type scale. Colors,
 * borders, buttons and spacing inside sections stay with the theme. */

.librespeed-columns {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
	gap: 1.5rem;
	align-items: start;
}

@media (max-width: 768px) {
	.librespeed-columns {
		grid-template-columns: 1fr;
	}
}

.librespeed-metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
	gap: 1rem;
	text-align: center;
	margin: 1rem 0;
}

.librespeed-value {
	font-size: 2.2em;
	font-weight: 500;
	line-height: 1.2;
}

.librespeed-value-sm {
	font-size: 1.5em;
	line-height: 1.2;
}

/* Muted through opacity rather than a hardcoded grey, so it dims whatever
 * foreground color the active theme uses. */
.librespeed-muted {
	opacity: .65;
}

.librespeed-caps {
	font-size: .85em;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.librespeed-center {
	text-align: center;
	padding: 1.5em 1em;
}

.librespeed-progress {
	width: 60%;
	max-width: 20em;
	display: inline-block;
	vertical-align: middle;
	accent-color: var(--librespeed-accent);
}

/* The chart takes its color from the theme where one is exposed, and falls
 * back to a neutral accent where none is. */
.librespeed-chart-line {
	stroke: var(--librespeed-accent);
	fill: none;
	stroke-width: 1.5;
}

.librespeed-chart-fill {
	fill: var(--librespeed-accent);
	fill-opacity: .1;
	stroke: none;
}

.librespeed-chart-band {
	fill: var(--librespeed-accent);
	fill-opacity: .18;
	stroke: none;
}

.librespeed-chart-dot {
	fill: var(--librespeed-accent);
}

.librespeed-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5em;
	margin: .4em 0;
}

.librespeed-push {
	margin-left: auto;
}

.librespeed-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5em;
	margin-top: .75em;
}

.librespeed-steps {
	display: flex;
	gap: 1.75em;
	justify-content: center;
	margin: .5em 0 0;
}

.librespeed-step { opacity: .35; }
.librespeed-step-active { opacity: 1; font-weight: 600; }
.librespeed-step-done { opacity: .65; }

.librespeed-spark {
	width: 100%;
	height: 72px;
	margin: .75em 0 0;
	display: block;
}

.librespeed-gauge {
	width: 250px;
	max-width: 100%;
	margin: .5em auto 0;
	display: block;
}

.librespeed-gauge-bg {
	fill: none;
	stroke: currentColor;
	stroke-opacity: .12;
	stroke-width: 12;
	stroke-linecap: round;
}

.librespeed-gauge-fill {
	fill: none;
	stroke: var(--librespeed-accent);
	stroke-width: 12;
	stroke-linecap: round;
}

.librespeed-gauge text { fill: currentColor; }

.librespeed-gauge-tick {
	stroke: currentColor;
	stroke-opacity: .25;
	stroke-width: 1.5;
}

.librespeed-gauge-needle {
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	opacity: .85;
}

.librespeed-gauge-hub { fill: currentColor; }

.librespeed-chart-holder { position: relative; }

.librespeed-guide {
	stroke: currentColor;
	stroke-opacity: .3;
	stroke-width: 1;
}

.librespeed-avg {
	stroke: currentColor;
	stroke-opacity: .45;
	stroke-width: 1;
	stroke-dasharray: 4 3;
}

.librespeed-tooltip {
	position: absolute;
	display: none;
	pointer-events: none;
	background: var(--background-color-high, #fff);
	color: var(--text-color-high, #333);
	border: 1px solid rgba(128, 128, 128, .4);
	border-radius: 3px;
	padding: .3em .6em;
	font-size: .85em;
	white-space: nowrap;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
	z-index: 50;
}

.librespeed-tooltip-row {
	display: flex;
	justify-content: space-between;
	gap: 1.25em;
}

.librespeed-stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5em;
	margin-top: .5em;
}

.librespeed-line { fill: none; stroke-width: 1.5; }
.librespeed-area { stroke: none; fill-opacity: .1; }
.librespeed-band { stroke: none; fill-opacity: .16; }
.librespeed-dot { stroke: none; }

.librespeed-avgline {
	fill: none;
	stroke-width: 1;
	stroke-dasharray: 4 3;
	stroke-opacity: .55;
}

/* One theme color for every series: the second one differs by pattern, not
 * by a hardcoded hue -- a dashed line and a striped swatch survive any theme
 * and read for color-blind users too. */
.librespeed-stroke-0 { stroke: var(--librespeed-accent); }
.librespeed-stroke-1 { stroke: var(--librespeed-accent); }
polyline.librespeed-stroke-1 { stroke-dasharray: 6 3; }
.librespeed-avgline.librespeed-stroke-1 { stroke-dasharray: 2 4; }
.librespeed-fill-0 { fill: var(--librespeed-accent); }
.librespeed-fill-1 { fill: var(--librespeed-accent); }
circle.librespeed-fill-1 { fill-opacity: .55; }
.librespeed-bg-0 { background: var(--librespeed-accent); }
.librespeed-bg-1 {
	background: repeating-linear-gradient(90deg,
		var(--librespeed-accent) 0 4px, transparent 4px 7px);
}

.librespeed-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
	margin: .35em 0 0;
}

.librespeed-legend-item {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	cursor: pointer;
}

.librespeed-swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
}

.librespeed-result-gauges {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5em;
	margin: .5em 0 0;
}

.librespeed-result-gauges .librespeed-gauge {
	width: 200px;
	margin: 0 auto;
}

.librespeed-fg-0 { color: var(--librespeed-accent); }
.librespeed-fg-1 { color: var(--librespeed-accent); }

.librespeed-cards {
	display: flex;
	flex-wrap: wrap;
	gap: .75em;
	margin: .35em 0 1em;
}

.librespeed-metric-card {
	border: 1px solid rgba(128, 128, 128, .25);
	border-top-width: 3px;
	border-radius: 4px;
	padding: .45em .9em;
	min-width: 11em;
	cursor: pointer;
	/* Dim, still legible: .5 with the muted name inside multiplied down to
	 * an unreadable third. */
	opacity: .78;
	user-select: none;
}

.librespeed-metric-card-on { opacity: 1; }
.librespeed-metric-card:hover { border-color: rgba(128, 128, 128, .45); }

.librespeed-accent-0 { border-top-color: var(--librespeed-accent); }
.librespeed-accent-1 { border-top-color: var(--librespeed-accent); border-top-style: dashed; }

.librespeed-card-value {
	font-size: 1.3em;
	font-weight: 600;
	line-height: 1.35;
}

.librespeed-hint {
	border-bottom: 1px dotted currentColor;
	cursor: help;
}

.librespeed-meta {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .15em 1.25em;
	width: fit-content;
	margin: 1em auto 0;
	text-align: left;
	font-size: .95em;
}

/* Off-screen but reachable: the live region announcing the running phase,
 * and the gauge figures repeated as plain text for browse mode. */
.librespeed-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}