vowel 0.7.8 → 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.
@@ -17,7 +17,7 @@
17
17
  --_name is internal to a sheet: computed here, not for setting.
18
18
  */
19
19
 
20
- @layer reset, typography, default, dynamic-typography;
20
+ @layer reset, typography, syntax-highlighting, default, dynamic-typography;
21
21
 
22
22
  @layer default {
23
23
  :root {
@@ -66,10 +66,29 @@
66
66
  --color-text-hover-panel: light-dark(var(--color-primary-02), var(--color-primary-08));
67
67
  --color-border-hover-panel: light-dark(var(--color-accent-08), var(--color-accent-05));
68
68
 
69
- /* pre colors */
70
- --color-background-pre: light-dark(var(--color-tertiary-09), var(--color-tertiary-02));
71
- --color-border-pre: light-dark(var(--color-tertiary-08), var(--color-tertiary-01));
72
- --color-text-pre: light-dark(var(--color-tertiary-02), var(--color-tertiary-02));
69
+ /*
70
+ pre colors, and the syntax-highlighting sheet's from the
71
+ palette: the text at the far end from the background, every
72
+ token one shade in, so each stays above 4.5:1 on the
73
+ background for any ordinary palette (tests/syntaxColors.js).
74
+ Comments too, told apart by italics: a shade lighter fell to
75
+ 4.2:1 on a palette from bright colours (#ffcc00, #66ff00).
76
+ */
77
+ --color-background-pre: light-dark(var(--color-tertiary-10), var(--color-tertiary-02));
78
+ --color-border-pre: light-dark(var(--color-tertiary-08), var(--color-tertiary-02));
79
+ --color-text-pre: light-dark(var(--color-tertiary-04), var(--color-tertiary-08));
80
+ --color-comment-pre: light-dark(var(--color-accent-04), var(--color-accent-09));
81
+ --color-keyword-pre: light-dark(var(--color-primary-04), var(--color-primary-07));
82
+ --color-function-pre: light-dark(var(--color-secondary-04), var(--color-secondary-07));
83
+ --color-constant-pre: light-dark(var(--color-info-04), var(--color-info-07));
84
+ --color-string-pre: light-dark(var(--color-tertiary-04), var(--color-tertiary-08));
85
+ --color-builtin-pre: light-dark(var(--color-warning-04), var(--color-warning-07));
86
+ --color-tag-pre: light-dark(var(--color-success-05), var(--color-success-07));
87
+ --color-list-pre: light-dark(var(--color-warning-05), var(--color-warning-07));
88
+ --color-inserted-pre: light-dark(var(--color-success-05), var(--color-success-07));
89
+ --color-background-inserted-pre: light-dark(var(--color-success-07), var(--color-success-05));
90
+ --color-deleted-pre: light-dark(var(--color-danger-05), var(--color-danger-07));
91
+ --color-background-deleted-pre: light-dark(var(--color-danger-07), var(--color-danger-05));
73
92
 
74
93
  /*
75
94
  alert colors: --color-{element}-alert-{type} for the types the
@@ -433,6 +452,7 @@
433
452
  /* position: relative; */
434
453
 
435
454
  table {
455
+
436
456
  th,
437
457
  td {
438
458
  vertical-align: top;
@@ -479,9 +499,13 @@
479
499
 
480
500
 
481
501
  pre,
482
- code,
483
- code.hljs {
484
- background: var(--color-background-pre) !important;
502
+ code {
503
+ background: var(--color-background-pre);
504
+ }
505
+
506
+ /* a comment is the text's colour, a shade lighter: italics tell it apart */
507
+ .token.comment {
508
+ font-style: italic;
485
509
  }
486
510
 
487
511
  blockquote {
@@ -540,6 +564,7 @@
540
564
  /* alerts */
541
565
 
542
566
  aside.alert {
567
+
543
568
  /* GitHub's CAUTION and TIP share DANGER's and SUCCESS's colours */
544
569
  &.danger,
545
570
  &.caution {
@@ -688,4 +713,4 @@
688
713
  }
689
714
 
690
715
  }
691
- }
716
+ }
@@ -1,269 +1,162 @@
1
1
  /*
2
- * Syntax highlighting theme for code blocks (rehype-highlight), based on
3
- * highlight.js's GitHub theme. Light by default, dark under
4
- * prefers-color-scheme - see highlight.js/styles/github.css and
5
- * github-dark.css for the source themes this was combined from.
2
+ * Syntax highlighting for code blocks, highlighted by Prism (refractor).
3
+ *
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
15
+ * would go to the end.
16
+ *
17
+ * Rules of the same specificity are in an order that matters: a token
18
+ * can have several classes (a heading is `title important`, a YAML key
19
+ * `key atrule`), and the later rule wins.
6
20
  */
7
- pre code.hljs {
8
- display: block;
9
- overflow-x: auto;
10
- padding: 1em
11
- }
12
-
13
- code.hljs {
14
- padding: 3px 5px
15
- }
16
-
17
- /*!
18
- Theme: GitHub
19
- Description: Light theme as seen on github.com
20
- Author: github.com
21
- Maintainer: @Hirse
22
- Updated: 2021-05-15
23
-
24
- Outdated base version: https://github.com/primer/github-syntax-light
25
- Current colors taken from GitHub's CSS
26
- */
27
- .hljs {
28
- color: #24292e;
29
- }
30
21
 
31
- .hljs-doctag,
32
- .hljs-keyword,
33
- .hljs-meta .hljs-keyword,
34
- .hljs-template-tag,
35
- .hljs-template-variable,
36
- .hljs-type,
37
- .hljs-variable.language_ {
38
- /* prettylights-syntax-keyword */
39
- color: #d73a49
40
- }
41
-
42
- .hljs-title,
43
- .hljs-title.class_,
44
- .hljs-title.class_.inherited__,
45
- .hljs-title.function_ {
46
- /* prettylights-syntax-entity */
47
- color: #6f42c1
48
- }
49
-
50
- .hljs-attr,
51
- .hljs-attribute,
52
- .hljs-literal,
53
- .hljs-meta,
54
- .hljs-number,
55
- .hljs-operator,
56
- .hljs-variable,
57
- .hljs-selector-attr,
58
- .hljs-selector-class,
59
- .hljs-selector-id {
60
- /* prettylights-syntax-constant */
61
- color: #005cc5
62
- }
63
-
64
- .hljs-regexp,
65
- .hljs-string,
66
- .hljs-meta .hljs-string {
67
- /* prettylights-syntax-string */
68
- color: #032f62
69
- }
70
-
71
- .hljs-built_in,
72
- .hljs-symbol {
73
- /* prettylights-syntax-variable */
74
- color: #e36209
75
- }
76
-
77
- .hljs-comment,
78
- .hljs-code,
79
- .hljs-formula {
80
- /* prettylights-syntax-comment */
81
- color: #6a737d
82
- }
83
-
84
- .hljs-name,
85
- .hljs-quote,
86
- .hljs-selector-tag,
87
- .hljs-selector-pseudo {
88
- /* prettylights-syntax-entity-tag */
89
- color: #22863a
90
- }
91
-
92
- .hljs-subst {
93
- /* prettylights-syntax-storage-modifier-import */
94
- color: #24292e
95
- }
96
-
97
- .hljs-section {
98
- /* prettylights-syntax-markup-heading */
99
- color: #005cc5;
100
- font-weight: bold
101
- }
102
-
103
- .hljs-bullet {
104
- /* prettylights-syntax-markup-list */
105
- color: #735c0f
106
- }
107
-
108
- .hljs-emphasis {
109
- /* prettylights-syntax-markup-italic */
110
- color: #24292e;
111
- font-style: italic
112
- }
113
-
114
- .hljs-strong {
115
- /* prettylights-syntax-markup-bold */
116
- color: #24292e;
117
- font-weight: bold
118
- }
119
-
120
- .hljs-addition {
121
- /* prettylights-syntax-markup-inserted */
122
- color: #22863a;
123
- background-color: #f0fff4
124
- }
125
-
126
- .hljs-deletion {
127
- /* prettylights-syntax-markup-deleted */
128
- color: #b31d28;
129
- background-color: #ffeef0
130
- }
131
-
132
- .hljs-char.escape_,
133
- .hljs-link,
134
- .hljs-params,
135
- .hljs-property,
136
- .hljs-punctuation,
137
- .hljs-tag {
138
- /* purposely ignored */
139
-
140
- }
141
-
142
- @media (prefers-color-scheme: dark) {
22
+ @layer reset, typography, syntax-highlighting, default, dynamic-typography;
23
+
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
+ }
143
41
 
144
- /*!
145
- Theme: GitHub Dark
146
- Description: Dark theme as seen on github.com
147
- Author: github.com
148
- Maintainer: @Hirse
149
- Updated: 2021-05-15
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
+ }
150
60
 
151
- Outdated base version: https://github.com/primer/github-syntax-dark
152
- Current colors taken from GitHub's CSS
153
- */
154
- .hljs {
155
- color: #c9d1d9;
156
- background: #0d1117
61
+ pre[class*="language-"] {
62
+ color: var(--color-text-pre);
63
+ background: var(--color-background-pre);
157
64
  }
158
65
 
159
- .hljs-doctag,
160
- .hljs-keyword,
161
- .hljs-meta .hljs-keyword,
162
- .hljs-template-tag,
163
- .hljs-template-variable,
164
- .hljs-type,
165
- .hljs-variable.language_ {
166
- /* prettylights-syntax-keyword */
167
- color: #ff7b72
66
+ pre[class*="language-"]>code {
67
+ display: block;
68
+ overflow-x: auto;
69
+ padding: 1em;
168
70
  }
169
71
 
170
- .hljs-title,
171
- .hljs-title.class_,
172
- .hljs-title.class_.inherited__,
173
- .hljs-title.function_ {
174
- /* prettylights-syntax-entity */
175
- color: #d2a8ff
72
+ .token.keyword,
73
+ .token.atrule,
74
+ .token.rule,
75
+ .token.important {
76
+ color: var(--color-keyword-pre);
176
77
  }
177
78
 
178
- .hljs-attr,
179
- .hljs-attribute,
180
- .hljs-literal,
181
- .hljs-meta,
182
- .hljs-number,
183
- .hljs-operator,
184
- .hljs-variable,
185
- .hljs-selector-attr,
186
- .hljs-selector-class,
187
- .hljs-selector-id {
188
- /* prettylights-syntax-constant */
189
- color: #79c0ff
79
+ .token.function,
80
+ .token.class-name {
81
+ color: var(--color-function-pre);
190
82
  }
191
83
 
192
- .hljs-regexp,
193
- .hljs-string,
194
- .hljs-meta .hljs-string {
195
- /* prettylights-syntax-string */
196
- color: #a5d6ff
84
+ .token.number,
85
+ .token.boolean,
86
+ .token.constant,
87
+ .token.operator,
88
+ .token.variable,
89
+ .token.property,
90
+ .token.attr-name,
91
+ .token.entity,
92
+ .token.doctype,
93
+ .token.prolog,
94
+ .token.key {
95
+ color: var(--color-constant-pre);
197
96
  }
198
97
 
199
- .hljs-built_in,
200
- .hljs-symbol {
201
- /* prettylights-syntax-variable */
202
- color: #ffa657
98
+ .token.string,
99
+ .token.char,
100
+ .token.attr-value,
101
+ .token.regex,
102
+ .token.url {
103
+ color: var(--color-string-pre);
203
104
  }
204
105
 
205
- .hljs-comment,
206
- .hljs-code,
207
- .hljs-formula {
208
- /* prettylights-syntax-comment */
209
- color: #8b949e
106
+ .token.builtin,
107
+ .token.symbol {
108
+ color: var(--color-builtin-pre);
210
109
  }
211
110
 
212
- .hljs-name,
213
- .hljs-quote,
214
- .hljs-selector-tag,
215
- .hljs-selector-pseudo {
216
- /* prettylights-syntax-entity-tag */
217
- color: #7ee787
111
+ /* also markdown's code, whose language is highlighted inside it */
112
+ .token.comment,
113
+ .token.cdata,
114
+ .token.code-snippet,
115
+ .token.code.keyword {
116
+ color: var(--color-comment-pre);
218
117
  }
219
118
 
220
- .hljs-subst {
221
- /* prettylights-syntax-storage-modifier-import */
222
- color: #c9d1d9
119
+ .token.tag,
120
+ .token.selector,
121
+ .token.blockquote {
122
+ color: var(--color-tag-pre);
223
123
  }
224
124
 
225
- .hljs-section {
226
- /* prettylights-syntax-markup-heading */
227
- color: #1f6feb;
228
- font-weight: bold
125
+ /* a markdown heading */
126
+ .token.title {
127
+ color: var(--color-constant-pre);
128
+ font-weight: bold;
229
129
  }
230
130
 
231
- .hljs-bullet {
232
- /* prettylights-syntax-markup-list */
233
- color: #f2cc60
131
+ .token.list,
132
+ .token.checkbox {
133
+ color: var(--color-list-pre);
234
134
  }
235
135
 
236
- .hljs-emphasis {
237
- /* prettylights-syntax-markup-italic */
238
- color: #c9d1d9;
239
- font-style: italic
136
+ .token.table-header {
137
+ color: inherit;
138
+ font-weight: bold;
240
139
  }
241
140
 
242
- .hljs-strong {
243
- /* prettylights-syntax-markup-bold */
244
- color: #c9d1d9;
245
- font-weight: bold
141
+ .token.bold {
142
+ font-weight: bold;
246
143
  }
247
144
 
248
- .hljs-addition {
249
- /* prettylights-syntax-markup-inserted */
250
- color: #aff5b4;
251
- background-color: #033a16
145
+ .token.italic {
146
+ font-style: italic;
252
147
  }
253
148
 
254
- .hljs-deletion {
255
- /* prettylights-syntax-markup-deleted */
256
- color: #ffdcd7;
257
- background-color: #67060c
149
+ .token.strike {
150
+ text-decoration: line-through;
258
151
  }
259
152
 
260
- .hljs-char.escape_,
261
- .hljs-link,
262
- .hljs-params,
263
- .hljs-property,
264
- .hljs-punctuation,
265
- .hljs-tag {
266
- /* purposely ignored */
153
+ .token.inserted {
154
+ color: var(--color-inserted-pre);
155
+ background-color: var(--color-background-inserted-pre);
156
+ }
267
157
 
158
+ .token.deleted {
159
+ color: var(--color-deleted-pre);
160
+ background-color: var(--color-background-deleted-pre);
268
161
  }
269
- }
162
+ }
@@ -1,4 +1,4 @@
1
- @layer reset, typography;
1
+ @layer reset, typography, syntax-highlighting;
2
2
 
3
3
  @layer typography {
4
4
 
@@ -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