remarque-tokens 0.6.0 → 0.6.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.
- package/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/scripts/audit.mjs +1 -0
- package/scripts/lib/css-tokens.mjs +10 -4
- package/tokens.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ All notable changes to `remarque-tokens` are documented here. Token value
|
|
|
4
4
|
changes always state the design rationale — downstream sites pin against
|
|
5
5
|
these entries when syncing.
|
|
6
6
|
|
|
7
|
+
## 0.6.1 — 2026-07-21
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
Three audit/parser bugs from real-world adoption (#67, found by tsundoku):
|
|
11
|
+
- Body-less at-statements (`@import`, `@charset`) preceding a block no
|
|
12
|
+
longer pollute its prelude and misclassify it as an at-rule — palette
|
|
13
|
+
files may begin with imports.
|
|
14
|
+
- Selector classification accepts qualified root forms (`html:root`,
|
|
15
|
+
`html[data-theme="dark"]`, `body.dark`, …) instead of exact strings.
|
|
16
|
+
- `--src` scans now strip HTML `<!-- -->` comments (line-numbers
|
|
17
|
+
preserved) like CSS comments, ending issue-number false positives in
|
|
18
|
+
.astro/.svelte markup.
|
|
19
|
+
|
|
20
|
+
Two new convention fixtures (leading-import, qualified-selectors) lock
|
|
21
|
+
the fixes in CI. Consumers can drop their documented workarounds.
|
|
22
|
+
|
|
7
23
|
## 0.6.0 — 2026-07-20
|
|
8
24
|
|
|
9
25
|
### Added
|
package/package.json
CHANGED
package/scripts/audit.mjs
CHANGED
|
@@ -165,6 +165,7 @@ for (const file of walk(SRC)) {
|
|
|
165
165
|
// prose like "(issue #324)" in a comment trips the hex-color regex.
|
|
166
166
|
const text = readFileSync(file, 'utf8')
|
|
167
167
|
.replace(/\/\*[\s\S]*?\*\//g, (m) => m.replace(/[^\n]/g, ' '))
|
|
168
|
+
.replace(/<!--[\s\S]*?-->/g, (m) => m.replace(/[^\n]/g, ' '))
|
|
168
169
|
.replace(/(^|[^:])\/\/[^\n]*/g, (m, p1) => p1 + ' '.repeat(m.length - p1.length));
|
|
169
170
|
const lines = text.split('\n');
|
|
170
171
|
lines.forEach((line, i) => {
|
|
@@ -16,7 +16,10 @@ export function extractBlocks(css) {
|
|
|
16
16
|
while (i < text.length) {
|
|
17
17
|
const open = text.indexOf('{', i);
|
|
18
18
|
if (open === -1) break;
|
|
19
|
-
|
|
19
|
+
// Body-less at-statements (@import 'x'; @charset ...;) preceding a block
|
|
20
|
+
// would otherwise pollute its prelude and misclassify it as an at-rule
|
|
21
|
+
// (#67): keep only the segment after the last ';'.
|
|
22
|
+
const prelude = text.slice(i, open).split(';').pop().trim();
|
|
20
23
|
let depth = 1, j = open + 1;
|
|
21
24
|
while (j < text.length && depth > 0) {
|
|
22
25
|
if (text[j] === '{') depth++;
|
|
@@ -49,12 +52,15 @@ export function declsOf(blocks, filterFn) {
|
|
|
49
52
|
dark block in the class convention) as light. */
|
|
50
53
|
const parts = (prelude) => prelude.split(',').map((s) => s.trim());
|
|
51
54
|
|
|
55
|
+
const DARKISH = /(\.dark\b|\[data-theme="dark"\])/;
|
|
56
|
+
const ROOTISH = /^(:root|html|body)\b/;
|
|
52
57
|
export const isLightRoot = (b) =>
|
|
53
|
-
b.context === '' && parts(b.prelude).some((s) =>
|
|
58
|
+
b.context === '' && parts(b.prelude).some((s) =>
|
|
59
|
+
(ROOTISH.test(s) && !DARKISH.test(s)) || s === '[data-theme="light"]');
|
|
54
60
|
|
|
55
61
|
/* Dark: media-query :root, the canonical [data-theme="dark"], or the
|
|
56
62
|
class-convention :root.dark / html.dark (compatibility bridge). */
|
|
57
63
|
export const isDarkBlock = (b) =>
|
|
58
64
|
(b.context.includes('prefers-color-scheme') && b.context.includes('dark') &&
|
|
59
|
-
parts(b.prelude).some((s) => s
|
|
60
|
-
parts(b.prelude).some((s) => s
|
|
65
|
+
parts(b.prelude).some((s) => ROOTISH.test(s) && !DARKISH.test(s))) ||
|
|
66
|
+
parts(b.prelude).some((s) => DARKISH.test(s) && (ROOTISH.test(s) || s.startsWith('.') || s.startsWith('[')));
|
package/tokens.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$description": "Remarque design tokens — GENERATED from tokens-core.css + tokens-palette.css by scripts/tokens-json.mjs. Do not edit; the CSS is the source of truth.",
|
|
3
3
|
"$extensions": {
|
|
4
4
|
"remarque": {
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.1",
|
|
6
6
|
"tiers": {
|
|
7
7
|
"core": "immutable identity — overriding forks the system",
|
|
8
8
|
"palette": "sanctioned personalization surface — override freely, then run remarque-audit"
|