vowel 0.8.0 → 0.8.1

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.
@@ -1,14 +1,17 @@
1
1
  /*
2
- * Syntax highlighting for code blocks, highlighted by Prism (refractor):
3
- * GitHub's light and dark colours, as highlight.js's GitHub themes had
4
- * them, on Prism's token classes. Light by default, dark under
5
- * prefers-color-scheme.
2
+ * Syntax highlighting for code blocks, highlighted by Prism (refractor).
6
3
  *
7
- * In its own layer, before the default theme's (per Sam), so a theme
8
- * overrides it: DefaultStyles.css's `pre, code` background replaces the
9
- * dark background here. A project's own stylesheet is unlayered, so it
10
- * overrides everything, a Prism theme included. The order is declared
11
- * in every theme sheet, because a layer named for the first time later
4
+ * Every colour is a variable, `--color-{role}-pre`, declared here with
5
+ * GitHub's light and dark colours, light by default and dark under
6
+ * prefers-color-scheme (not light-dark(), which needs a color-scheme
7
+ * this sheet has no business setting). The default theme redeclares
8
+ * them from the site's palette, and a project's styles.css can set any
9
+ * one of them: `:root { --color-keyword-pre: crimson }`.
10
+ *
11
+ * In its own layer, before the default theme's (per Sam), so the theme
12
+ * overrides it; a project's own stylesheet is unlayered and overrides
13
+ * everything, a whole Prism theme included. The order is declared in
14
+ * every theme sheet, because a layer named for the first time later
12
15
  * would go to the end.
13
16
  *
14
17
  * Rules of the same specificity are in an order that matters: a token
@@ -19,8 +22,45 @@
19
22
  @layer reset, typography, syntax-highlighting, default, dynamic-typography;
20
23
 
21
24
  @layer syntax-highlighting {
25
+ :root {
26
+ --color-text-pre: #24292e;
27
+ --color-background-pre: #ffffff;
28
+ --color-comment-pre: #6a737d;
29
+ --color-keyword-pre: #d73a49;
30
+ --color-function-pre: #6f42c1;
31
+ --color-constant-pre: #005cc5;
32
+ --color-string-pre: #032f62;
33
+ --color-builtin-pre: #e36209;
34
+ --color-tag-pre: #22863a;
35
+ --color-list-pre: #735c0f;
36
+ --color-inserted-pre: #22863a;
37
+ --color-background-inserted-pre: #f0fff4;
38
+ --color-deleted-pre: #b31d28;
39
+ --color-background-deleted-pre: #ffeef0;
40
+ }
41
+
42
+ @media (prefers-color-scheme: dark) {
43
+ :root {
44
+ --color-text-pre: #c9d1d9;
45
+ --color-background-pre: #0d1117;
46
+ --color-comment-pre: #8b949e;
47
+ --color-keyword-pre: #ff7b72;
48
+ --color-function-pre: #d2a8ff;
49
+ --color-constant-pre: #79c0ff;
50
+ --color-string-pre: #a5d6ff;
51
+ --color-builtin-pre: #ffa657;
52
+ --color-tag-pre: #7ee787;
53
+ --color-list-pre: #f2cc60;
54
+ --color-inserted-pre: #aff5b4;
55
+ --color-background-inserted-pre: #033a16;
56
+ --color-deleted-pre: #ffdcd7;
57
+ --color-background-deleted-pre: #67060c;
58
+ }
59
+ }
60
+
22
61
  pre[class*="language-"] {
23
- color: #24292e;
62
+ color: var(--color-text-pre);
63
+ background: var(--color-background-pre);
24
64
  }
25
65
 
26
66
  pre[class*="language-"]>code {
@@ -29,21 +69,18 @@
29
69
  padding: 1em;
30
70
  }
31
71
 
32
- /* prettylights-syntax-keyword */
33
72
  .token.keyword,
34
73
  .token.atrule,
35
74
  .token.rule,
36
75
  .token.important {
37
- color: #d73a49;
76
+ color: var(--color-keyword-pre);
38
77
  }
39
78
 
40
- /* prettylights-syntax-entity */
41
79
  .token.function,
42
80
  .token.class-name {
43
- color: #6f42c1;
81
+ color: var(--color-function-pre);
44
82
  }
45
83
 
46
- /* prettylights-syntax-constant */
47
84
  .token.number,
48
85
  .token.boolean,
49
86
  .token.constant,
@@ -55,50 +92,45 @@
55
92
  .token.doctype,
56
93
  .token.prolog,
57
94
  .token.key {
58
- color: #005cc5;
95
+ color: var(--color-constant-pre);
59
96
  }
60
97
 
61
- /* prettylights-syntax-string */
62
98
  .token.string,
63
99
  .token.char,
64
100
  .token.attr-value,
65
101
  .token.regex,
66
102
  .token.url {
67
- color: #032f62;
103
+ color: var(--color-string-pre);
68
104
  }
69
105
 
70
- /* prettylights-syntax-variable */
71
106
  .token.builtin,
72
107
  .token.symbol {
73
- color: #e36209;
108
+ color: var(--color-builtin-pre);
74
109
  }
75
110
 
76
- /* prettylights-syntax-comment: also markdown's code, whose language
77
- is highlighted inside it */
111
+ /* also markdown's code, whose language is highlighted inside it */
78
112
  .token.comment,
79
113
  .token.cdata,
80
114
  .token.code-snippet,
81
115
  .token.code.keyword {
82
- color: #6a737d;
116
+ color: var(--color-comment-pre);
83
117
  }
84
118
 
85
- /* prettylights-syntax-entity-tag */
86
119
  .token.tag,
87
120
  .token.selector,
88
121
  .token.blockquote {
89
- color: #22863a;
122
+ color: var(--color-tag-pre);
90
123
  }
91
124
 
92
- /* prettylights-syntax-markup-heading */
125
+ /* a markdown heading */
93
126
  .token.title {
94
- color: #005cc5;
127
+ color: var(--color-constant-pre);
95
128
  font-weight: bold;
96
129
  }
97
130
 
98
- /* prettylights-syntax-markup-list */
99
131
  .token.list,
100
132
  .token.checkbox {
101
- color: #735c0f;
133
+ color: var(--color-list-pre);
102
134
  }
103
135
 
104
136
  .token.table-header {
@@ -118,97 +150,13 @@
118
150
  text-decoration: line-through;
119
151
  }
120
152
 
121
- /* prettylights-syntax-markup-inserted */
122
153
  .token.inserted {
123
- color: #22863a;
124
- background-color: #f0fff4;
154
+ color: var(--color-inserted-pre);
155
+ background-color: var(--color-background-inserted-pre);
125
156
  }
126
157
 
127
- /* prettylights-syntax-markup-deleted */
128
158
  .token.deleted {
129
- color: #b31d28;
130
- background-color: #ffeef0;
131
- }
132
-
133
- @media (prefers-color-scheme: dark) {
134
- pre[class*="language-"] {
135
- color: #c9d1d9;
136
- background: #0d1117;
137
- }
138
-
139
- .token.keyword,
140
- .token.atrule,
141
- .token.rule,
142
- .token.important {
143
- color: #ff7b72;
144
- }
145
-
146
- .token.function,
147
- .token.class-name {
148
- color: #d2a8ff;
149
- }
150
-
151
- .token.number,
152
- .token.boolean,
153
- .token.constant,
154
- .token.operator,
155
- .token.variable,
156
- .token.property,
157
- .token.attr-name,
158
- .token.entity,
159
- .token.doctype,
160
- .token.prolog,
161
- .token.key {
162
- color: #79c0ff;
163
- }
164
-
165
- .token.string,
166
- .token.char,
167
- .token.attr-value,
168
- .token.regex,
169
- .token.url {
170
- color: #a5d6ff;
171
- }
172
-
173
- .token.builtin,
174
- .token.symbol {
175
- color: #ffa657;
176
- }
177
-
178
- .token.comment,
179
- .token.cdata,
180
- .token.code-snippet,
181
- .token.code.keyword {
182
- color: #8b949e;
183
- }
184
-
185
- .token.tag,
186
- .token.selector,
187
- .token.blockquote {
188
- color: #7ee787;
189
- }
190
-
191
- .token.title {
192
- color: #1f6feb;
193
- }
194
-
195
- .token.list,
196
- .token.checkbox {
197
- color: #f2cc60;
198
- }
199
-
200
- .token.table-header {
201
- color: inherit;
202
- }
203
-
204
- .token.inserted {
205
- color: #aff5b4;
206
- background-color: #033a16;
207
- }
208
-
209
- .token.deleted {
210
- color: #ffdcd7;
211
- background-color: #67060c;
212
- }
159
+ color: var(--color-deleted-pre);
160
+ background-color: var(--color-background-deleted-pre);
213
161
  }
214
162
  }
@@ -63,11 +63,19 @@
63
63
  --fontsize-root: clamp(1rem, 0.875rem + 0.333vw, 1.125rem);
64
64
 
65
65
  /*
66
- the difference in size of h1 relative to the root
67
- font size; increase or decrease this number for larger or
68
- smaller headings
66
+ how much larger h1 is than the root font size, as a multiple
67
+ of it: 1.5 makes h1 2.5 times the size of body text; increase
68
+ or decrease this number for larger or smaller headings
69
+
70
+ the heading sizes are computed here, on :root, once: set
71
+ this and the variables below on :root (in a stylesheet linked
72
+ from one page or folder, for those pages), since setting them
73
+ on another element changes nothing
69
74
  */
70
- --fontsize-delta: calc(1.5 * var(--fontsize-root));
75
+ --fontsize-scale: 1.5;
76
+
77
+ /* the same difference as a length, which the sizes are computed from */
78
+ --fontsize-delta: calc(var(--fontsize-scale) * var(--fontsize-root));
71
79
 
72
80
  /*
73
81
  the rate of decay from h1 to h6 font size, where h6 is
@@ -232,8 +240,9 @@
232
240
  font-style: italic;
233
241
  }
234
242
 
235
- nav a:where([aria-current='page'], [aria-current='true']),
236
- nav a:where([aria-current='page'], [aria-current='true']):hover {
243
+ /* the page itself; a folder above it (aria-current=true) is still a link to go to */
244
+ nav a[aria-current='page'],
245
+ nav a[aria-current='page']:hover {
237
246
  cursor: default;
238
247
  }
239
248
 
package/version.js ADDED
@@ -0,0 +1,9 @@
1
+ import { readFileSync } from "node:fs"
2
+
3
+ /**
4
+ * This vowel's version, from its package.json: the build cache's key
5
+ * (config.js) and the pages' `<meta name=generator>`. A module of its
6
+ * own because config.js imports the plugins, so a plugin can't import
7
+ * config.js.
8
+ */
9
+ export const VOWEL_VERSION = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")).version