@jsb188/css 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/_colors.generated.css +210 -0
- package/css/_global.css +2606 -957
- package/css/_responsive.css +8068 -1934
- package/css/_responsive.generated.css +7220 -1520
- package/css/_sizing.css +1657 -459
- package/css/alert.css +84 -17
- package/css/animate.css +598 -194
- package/css/form.css +438 -235
- package/css/layout.css +303 -149
- package/css/loading.css +117 -105
- package/css/misc.css +3 -75
- package/css/modal.css +38 -73
- package/css/popover.css +51 -53
- package/package.json +23 -22
- package/scripts/generateResponsiveCss.js +202 -116
package/css/popover.css
CHANGED
|
@@ -1,131 +1,129 @@
|
|
|
1
|
-
|
|
2
1
|
/* Pop overs */
|
|
3
2
|
|
|
4
3
|
.popover {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
position: fixed;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: flex-start;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
.popover .tooltip {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
box-shadow: var(--shadow);
|
|
11
|
+
display: inline-block;
|
|
12
|
+
padding: 0.58rem 0.64rem;
|
|
13
|
+
/* box-shadow: var(--shadow-light); */
|
|
14
|
+
box-shadow: var(--shadow);
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
.popover.small .tooltip:not(.w_override) {
|
|
20
|
-
|
|
18
|
+
max-width: 150px;
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
.popover.default .tooltip:not(.w_override) {
|
|
24
|
-
|
|
22
|
+
max-width: 200px;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
/* Pop over; list */
|
|
28
26
|
|
|
29
27
|
.po_list {
|
|
30
|
-
|
|
28
|
+
border-radius: 6px;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
.po_list .inside {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
/* padding: 5px; */
|
|
33
|
+
padding: 5px;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
justify-content: flex-start;
|
|
37
|
+
align-items: stretch;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
.po_list.bg a:hover {
|
|
42
|
-
|
|
41
|
+
background-color: var(--color-darker-light);
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
.po_list .av_item .av.main {
|
|
46
|
-
|
|
45
|
+
box-shadow: 0 0 10px rgb(var(--color-bg));
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
/* Pop over; subtitle */
|
|
50
49
|
|
|
51
50
|
.po_subtitle {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
height: 5px;
|
|
51
|
+
position: sticky;
|
|
52
|
+
top: 0;
|
|
53
|
+
left: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
padding: 5px 0.4rem 8px;
|
|
56
|
+
margin-bottom: 0.3rem;
|
|
57
|
+
box-shadow:
|
|
58
|
+
0 -5px 0 rgb(var(--color-bg)),
|
|
59
|
+
0 0 7px rgb(var(--color-bg));
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
/* Pop over; list item */
|
|
65
63
|
|
|
66
64
|
.po_opt .saving_area {
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
width: 24px;
|
|
66
|
+
transform: translateX(-4px);
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
.po_opt {
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
padding: 5px 0 5px 0.4375rem;
|
|
71
|
+
border-radius: 5px;
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
.po_opt.default:first-child {
|
|
77
|
-
|
|
75
|
+
margin-top: 5px;
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
.po_opt.default:last-child {
|
|
81
|
-
|
|
79
|
+
margin-bottom: 5px;
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
/* Pop over; text item */
|
|
85
83
|
|
|
86
84
|
.po_opt.text_item {
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
padding: 5px 0.4375rem;
|
|
86
|
+
margin-bottom: 0;
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
/* Pop over; different presets for list item */
|
|
92
90
|
|
|
93
91
|
.po_opt.av_item {
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
padding-top: 0.5rem;
|
|
93
|
+
padding-bottom: 0.5rem;
|
|
96
94
|
}
|
|
97
95
|
|
|
98
96
|
.po_opt.preset_small {
|
|
99
|
-
|
|
97
|
+
padding: 0.5rem 0 0.5rem 0.4375rem;
|
|
100
98
|
}
|
|
101
99
|
|
|
102
100
|
/* Pop over; list break */
|
|
103
101
|
|
|
104
102
|
.po_list_break {
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
margin: 4px 0;
|
|
104
|
+
border-top: solid 1px var(--color-darker-light);
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
/* Pop over container */
|
|
110
108
|
|
|
111
109
|
.po_container {
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
/* padding: 4px; */
|
|
111
|
+
box-shadow: var(--shadow-light);
|
|
114
112
|
}
|
|
115
113
|
|
|
116
114
|
.po_container .inside {
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
119
117
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
width: 300px;
|
|
119
|
+
min-height: 150px;
|
|
120
|
+
/* max-height: calc(100vh - 20px); */
|
|
121
|
+
max-height: 70vh;
|
|
124
122
|
}
|
|
125
123
|
|
|
126
124
|
/* Pop over image */
|
|
127
125
|
|
|
128
126
|
.pu_img {
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
max-width: 400px;
|
|
128
|
+
margin: 10px; /* 10px is also hard coded into the React Component */
|
|
131
129
|
}
|
package/package.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
"name": "@jsb188/css",
|
|
3
|
+
"version": "1.1.12",
|
|
4
|
+
"description": "Re-usable, base CSS styles for any app (NOTE: Bring your own variables).",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "jsb188",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./_global.css": "./css/_global.css",
|
|
10
|
+
"./_colors.generated.css": "./css/_colors.generated.css",
|
|
11
|
+
"./alert.css": "./css/alert.css",
|
|
12
|
+
"./animate.css": "./css/animate.css",
|
|
13
|
+
"./form.css": "./css/form.css",
|
|
14
|
+
"./layout.css": "./css/layout.css",
|
|
15
|
+
"./loading.css": "./css/loading.css",
|
|
16
|
+
"./misc.css": "./css/misc.css",
|
|
17
|
+
"./modal.css": "./css/modal.css",
|
|
18
|
+
"./popover.css": "./css/popover.css"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"gen:responsive-css": "node ./scripts/generateResponsiveCss.js",
|
|
22
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {}
|
|
24
25
|
}
|
|
@@ -10,49 +10,56 @@ const responsiveOutputPath = path.join(cssDir, '_responsive.generated.css');
|
|
|
10
10
|
const colorsOutputPath = path.join(cssDir, '_colors.generated.css');
|
|
11
11
|
|
|
12
12
|
const responsiveBreakpoints = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
['landscape', '--responsive-mobile-landscape'],
|
|
14
|
+
['portrait', '--responsive-mobile-portrait'],
|
|
15
|
+
['phone', '--responsive-phone-wide'],
|
|
16
|
+
['narrow', '--responsive-phone-narrow'],
|
|
17
|
+
['tiny', '--responsive-phone-tiny'],
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
const colorPalettes = [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
21
|
+
'red',
|
|
22
|
+
'orange',
|
|
23
|
+
'brown',
|
|
24
|
+
'amber',
|
|
25
|
+
'yellow',
|
|
26
|
+
'lime',
|
|
27
|
+
'green',
|
|
28
|
+
'emerald',
|
|
29
|
+
'teal',
|
|
30
|
+
'cyan',
|
|
31
|
+
'sky',
|
|
32
|
+
'blue',
|
|
33
|
+
'indigo',
|
|
34
|
+
'violet',
|
|
35
|
+
'purple',
|
|
36
|
+
'fuchsia',
|
|
37
|
+
'pink',
|
|
38
|
+
'rose',
|
|
39
|
+
'slate',
|
|
40
|
+
'zinc',
|
|
41
|
+
'stone',
|
|
42
42
|
];
|
|
43
43
|
|
|
44
44
|
const colorShades = [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
['fd', 'fade'],
|
|
46
|
+
['lt', 'light'],
|
|
47
|
+
['md', 'medium'],
|
|
48
|
+
['bd', 'bold'],
|
|
49
|
+
['', 'default'],
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const colorAltShades = [
|
|
53
|
+
['fd', 'fade'],
|
|
54
|
+
['lt', 'light'],
|
|
55
|
+
['md', 'medium'],
|
|
56
|
+
['df', 'default'],
|
|
50
57
|
];
|
|
51
58
|
|
|
52
59
|
const colorRuleGroups = [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
['cl', 'color'],
|
|
61
|
+
['bg', 'background-color'],
|
|
62
|
+
['bd', 'border-color'],
|
|
56
63
|
];
|
|
57
64
|
|
|
58
65
|
/*
|
|
@@ -60,7 +67,7 @@ Reads the source responsive utility CSS file that will be expanded into
|
|
|
60
67
|
breakpoint-scoped utility classes.
|
|
61
68
|
*/
|
|
62
69
|
async function readSourceCSS() {
|
|
63
|
-
|
|
70
|
+
return readFile(responsiveSourcePath, 'utf8');
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
/*
|
|
@@ -68,15 +75,16 @@ Extracts simple single-selector utility rules from the source CSS file so each
|
|
|
68
75
|
selector can be cloned with responsive prefixes.
|
|
69
76
|
*/
|
|
70
77
|
function parseUtilityRules(sourceCSS) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
const utilityRulePattern =
|
|
79
|
+
/(^|\n)\s*(\.[A-Za-z0-9_-][A-Za-z0-9_-]*)\s*\{([^}]*)\}/g;
|
|
80
|
+
|
|
81
|
+
return Array.from(
|
|
82
|
+
sourceCSS.matchAll(utilityRulePattern),
|
|
83
|
+
([, , selector, declarations]) => ({
|
|
84
|
+
selector,
|
|
85
|
+
declarations: declarations.trim(),
|
|
86
|
+
}),
|
|
87
|
+
);
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
/*
|
|
@@ -84,45 +92,92 @@ Builds the generated CSS file contents by wrapping cloned utility selectors in
|
|
|
84
92
|
their corresponding custom-media breakpoints.
|
|
85
93
|
*/
|
|
86
94
|
function buildGeneratedResponsiveCSS(rules) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
const sections = responsiveBreakpoints.map(([prefix, mediaName]) => {
|
|
96
|
+
const clonedRules = rules.map(({ selector, declarations }) => {
|
|
97
|
+
const className = selector.slice(1);
|
|
98
|
+
|
|
99
|
+
return ` .${prefix}\\:${className} { ${declarations} }`;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return `@media (${mediaName}) {\n${clonedRules.join('\n')}\n}`;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
return [
|
|
106
|
+
'/* This file is auto-generated by scripts/generateResponsiveCss.js. */',
|
|
107
|
+
'/* Do not edit this file directly. Edit _responsive.css and regenerate. */',
|
|
108
|
+
'',
|
|
109
|
+
...sections,
|
|
110
|
+
'',
|
|
111
|
+
].join('\n');
|
|
104
112
|
}
|
|
105
113
|
|
|
106
114
|
/*
|
|
107
115
|
Builds one palette utility rule for a color, shade, and CSS property group.
|
|
108
116
|
Default background rules also set a readable foreground color.
|
|
109
117
|
*/
|
|
110
|
-
function buildColorRule(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
function buildColorRule(
|
|
119
|
+
rulePrefix,
|
|
120
|
+
propertyName,
|
|
121
|
+
palette,
|
|
122
|
+
classSuffix,
|
|
123
|
+
tokenSuffix,
|
|
124
|
+
) {
|
|
125
|
+
const shadeClassSuffix = classSuffix ? `_${classSuffix}` : '';
|
|
126
|
+
const className = `${rulePrefix}_${palette}${shadeClassSuffix}`;
|
|
127
|
+
const selectors = [`.${className}`, `.${className}_hv:hover`];
|
|
128
|
+
const declarations = [
|
|
129
|
+
`${propertyName}: var(--color-${palette}-${tokenSuffix}) !important;`,
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
if (rulePrefix === 'bg' && tokenSuffix === 'default') {
|
|
133
|
+
declarations.push('color: var(--color-solid) !important;');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return `${selectors.join(', ')} { ${declarations.join(' ')} }`;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/*
|
|
140
|
+
Builds one alt background utility rule for a color and shade.
|
|
141
|
+
*/
|
|
142
|
+
function buildAltBackgroundColorRule(palette, classSuffix, tokenSuffix) {
|
|
143
|
+
const className = `bg_${palette}_alt_${classSuffix}`;
|
|
144
|
+
const selectors = [`.${className}`, `.${className}_hv:hover`];
|
|
145
|
+
|
|
146
|
+
return `${selectors.join(', ')} { background-color: var(--color-${palette}-alt-${tokenSuffix}) !important; }`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
Builds one alt foreground/border utility rule for a color, mapping the bare
|
|
151
|
+
"_alt" suffix to the muted-vivid alt-default token.
|
|
152
|
+
*/
|
|
153
|
+
function buildAltColorRule(rulePrefix, propertyName, palette) {
|
|
154
|
+
const className = `${rulePrefix}_${palette}_alt`;
|
|
155
|
+
const selectors = [`.${className}`, `.${className}_hv:hover`];
|
|
156
|
+
|
|
157
|
+
return `${selectors.join(', ')} { ${propertyName}: var(--color-${palette}-alt-default) !important; }`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/*
|
|
161
|
+
Builds one outline utility rule for a palette's default or light token,
|
|
162
|
+
including the equivalent alt token when requested.
|
|
163
|
+
*/
|
|
164
|
+
function buildOutlineColorRule(
|
|
165
|
+
palette,
|
|
166
|
+
classSuffix,
|
|
167
|
+
tokenSuffix,
|
|
168
|
+
isAlt = false,
|
|
169
|
+
) {
|
|
170
|
+
const altClassSuffix = isAlt ? '_alt' : '';
|
|
171
|
+
const shadeClassSuffix = classSuffix ? `_${classSuffix}` : '';
|
|
172
|
+
const altTokenSuffix = isAlt ? '-alt' : '';
|
|
173
|
+
const className = `ol_${palette}${altClassSuffix}${shadeClassSuffix}`;
|
|
174
|
+
const selectors = [
|
|
175
|
+
`.${className}`,
|
|
176
|
+
`.${className}_hv:hover`,
|
|
177
|
+
`.${className}_focus:focus`,
|
|
178
|
+
];
|
|
179
|
+
|
|
180
|
+
return `${selectors.join(', ')} { outline: 3px solid rgb(var(--color-${palette}${altTokenSuffix}-${tokenSuffix})); outline-offset: -1px; }`;
|
|
126
181
|
}
|
|
127
182
|
|
|
128
183
|
/*
|
|
@@ -130,31 +185,58 @@ Builds the generated color utility CSS file contents from palette, shade, and
|
|
|
130
185
|
property rule definitions.
|
|
131
186
|
*/
|
|
132
187
|
function buildGeneratedColorsCSS() {
|
|
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
|
-
|
|
188
|
+
const sections = colorRuleGroups.map(([rulePrefix, propertyName]) => {
|
|
189
|
+
const rules = colorPalettes.flatMap((palette) => {
|
|
190
|
+
const paletteRules = colorShades.map(([classSuffix, tokenSuffix]) => {
|
|
191
|
+
return buildColorRule(
|
|
192
|
+
rulePrefix,
|
|
193
|
+
propertyName,
|
|
194
|
+
palette,
|
|
195
|
+
classSuffix,
|
|
196
|
+
tokenSuffix,
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
if (rulePrefix === 'bg') {
|
|
201
|
+
return [
|
|
202
|
+
...paletteRules,
|
|
203
|
+
...colorAltShades.map(([classSuffix, tokenSuffix]) => {
|
|
204
|
+
return buildAltBackgroundColorRule(
|
|
205
|
+
palette,
|
|
206
|
+
classSuffix,
|
|
207
|
+
tokenSuffix,
|
|
208
|
+
);
|
|
209
|
+
}),
|
|
210
|
+
];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return [
|
|
214
|
+
...paletteRules,
|
|
215
|
+
buildAltColorRule(rulePrefix, propertyName, palette),
|
|
216
|
+
];
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
return rules.join('\n');
|
|
220
|
+
});
|
|
221
|
+
const outlineRules = colorPalettes.flatMap((palette) => {
|
|
222
|
+
return [
|
|
223
|
+
buildOutlineColorRule(palette, '', 'default'),
|
|
224
|
+
buildOutlineColorRule(palette, 'lt', 'light'),
|
|
225
|
+
buildOutlineColorRule(palette, '', 'default', true),
|
|
226
|
+
buildOutlineColorRule(palette, 'lt', 'light', true),
|
|
227
|
+
];
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
return [
|
|
231
|
+
'/* This file is auto-generated by scripts/generateResponsiveCss.js. */',
|
|
232
|
+
'/* Do not edit this file directly. Update the color generator definitions and regenerate. */',
|
|
233
|
+
'',
|
|
234
|
+
'/* Colors - Palette */',
|
|
235
|
+
'',
|
|
236
|
+
...sections,
|
|
237
|
+
outlineRules.join('\n'),
|
|
238
|
+
'',
|
|
239
|
+
].join('\n');
|
|
158
240
|
}
|
|
159
241
|
|
|
160
242
|
/*
|
|
@@ -162,8 +244,8 @@ Writes a generated CSS file to the shared CSS package so apps can import it
|
|
|
162
244
|
through the existing global stylesheet.
|
|
163
245
|
*/
|
|
164
246
|
async function writeGeneratedCSS(outputPath, outputCSS) {
|
|
165
|
-
|
|
166
|
-
|
|
247
|
+
await mkdir(cssDir, { recursive: true });
|
|
248
|
+
await writeFile(outputPath, outputCSS, 'utf8');
|
|
167
249
|
}
|
|
168
250
|
|
|
169
251
|
/*
|
|
@@ -171,18 +253,22 @@ Generates the shared CSS files that can be derived from compact utility
|
|
|
171
253
|
definitions.
|
|
172
254
|
*/
|
|
173
255
|
async function main() {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
256
|
+
const sourceCSS = await readSourceCSS();
|
|
257
|
+
const rules = parseUtilityRules(sourceCSS);
|
|
258
|
+
const responsiveOutputCSS = buildGeneratedResponsiveCSS(rules);
|
|
259
|
+
const colorsOutputCSS = buildGeneratedColorsCSS();
|
|
260
|
+
|
|
261
|
+
await Promise.all([
|
|
262
|
+
writeGeneratedCSS(responsiveOutputPath, responsiveOutputCSS),
|
|
263
|
+
writeGeneratedCSS(colorsOutputPath, colorsOutputCSS),
|
|
264
|
+
]);
|
|
265
|
+
|
|
266
|
+
console.log(
|
|
267
|
+
`Generated ${path.relative(process.cwd(), responsiveOutputPath)} from ${path.relative(process.cwd(), responsiveSourcePath)}.`,
|
|
268
|
+
);
|
|
269
|
+
console.log(
|
|
270
|
+
`Generated ${path.relative(process.cwd(), colorsOutputPath)} from color generator definitions.`,
|
|
271
|
+
);
|
|
186
272
|
}
|
|
187
273
|
|
|
188
274
|
await main();
|