/
system.ts
98 lines (96 loc) · 1.98 KB
/
system.ts
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
/**
* @remarks
* Reference: https://www.w3.org/TR/css-color-4/#typedef-system-color
*/
export interface SystemColors {
/**
* Background of application content or documents.
*/
canvas: string;
/**
* Text in application content or documents.
*/
canvastext: string;
/**
* Text in non-active, non-visited links. For light backgrounds,
* traditionally blue.
*/
linktext: string;
/**
* Text in visited links. For light backgrounds, traditionally purple.
*/
visitedtext: string;
/**
* Text in active links. For light backgrounds, traditionally red.
*/
activetext: string;
/**
* The face background color for push buttons.
*/
buttonface: string;
/**
* Text on push buttons.
*/
buttontext: string;
/**
* The base border color for push buttons.
*/
buttonborder: string;
/**
* Background of input fields.
*/
field: string;
/**
* Text in input fields.
*/
fieldtext: string;
/**
* Background of selected items/text.
*/
highlight: string;
/**
* Text of selected items/text.
*/
highlighttext: string;
/**
* Background of text that has been specially marked (such as by the HTML
* mark element).
*/
mark: string;
/**
* Text that has been specially marked (such as by the HTML mark element).
*/
marktext: string;
/**
* Disabled text. (Often, but not necessarily, gray.)
*/
graytext: string;
}
/**
* Default CSS system colors used by {@link parseCss}. Use
* {@link setSystemColors} to provide custom defaults.
*/
export let CSS_SYSTEM_COLORS: SystemColors = {
canvas: "fff",
canvastext: "000",
linktext: "001ee4",
visitedtext: "4e2386",
activetext: "eb3323",
buttonface: "ddd",
buttontext: "000",
buttonborder: "000",
field: "fff",
fieldtext: "000",
highlight: "bbd5fb",
highlighttext: "000",
mark: "000",
marktext: "fff",
graytext: "808080",
};
/**
* Merges {@link CSS_SYSTEM_COLORS} w/ new values.
*
* @param cols -
*/
export const setSystemColors = (cols: Partial<SystemColors>) =>
Object.assign(CSS_SYSTEM_COLORS, cols);