An open source design system that's fully customizable and agent ready
TypeScript
fix(themes): Stone, Y2K and Gothic set their CodeBlock diff row slots (#7428)
Cindy Zhanga84a895f77f4
diff --git a/.changeset/page-themes-diff-slots.md b/.changeset/page-themes-diff-slots.mdnew file mode 100644index 0000000000..fde08cb11f--- /dev/null+++ b/.changeset/page-themes-diff-slots.md@@ -0,0 +1,10 @@+---+'@astryxdesign/theme-stone': patch+'@astryxdesign/theme-y2k': patch+'@astryxdesign/theme-gothic': patch+'@astryxdesign/cli': patch+---++[fix] Stone, Y2K, and Gothic set `CodeBlock`'s diff row slots in their own syntax palettes, so a reader of a diff on those themes gets added and removed rows whose code, line numbers, and `+`/`-` glyphs stay readable: every syntax token keeps at least 4.5:1 on the tinted rows in Stone (light and dark) and Y2K (light and dark), and in Gothic the rows take a deep green and a deep red at the background's own luminance, so every token keeps the contrast it has on the plain background. Line numbers and glyphs on changed rows use each theme's own green and red. The CLI's bundled copies of the three themes (`astryx theme eject`) carry the same palettes.++@cixzhangdiff --git a/packages/cli/assets/templates/themes/gothic/gothicTheme.ts b/packages/cli/assets/templates/themes/gothic/gothicTheme.tsindex 82b6c4af27..740d15f534 100644--- a/packages/cli/assets/templates/themes/gothic/gothicTheme.ts+++ b/packages/cli/assets/templates/themes/gothic/gothicTheme.ts@@ -40,6 +40,15 @@ const gothicSyntax = defineSyntaxTheme({property: '#7cc5b3', // Verdigrispunctuation: '#7a8290', // Mid neutralbackground: '#101314',+ // Diff rows on the near-black background: any lighter wash lowers every+ // light token's contrast, so the rows take opaque hues at the+ // background's own luminance — a deep green and a deep red that read as+ // colour, not brightness — and every token keeps the contrast it has on+ // the plain background. Markers: forest moss and blood crimson.+ added: '#081408',+ removed: '#1e0a0a',+ 'added-marker': '#a3c987',+ 'removed-marker': '#d97580',},});diff --git a/packages/cli/assets/templates/themes/stone/stoneTheme.ts b/packages/cli/assets/templates/themes/stone/stoneTheme.tsindex 3f741a23db..4db4a099d8 100644--- a/packages/cli/assets/templates/themes/stone/stoneTheme.ts+++ b/packages/cli/assets/templates/themes/stone/stoneTheme.ts@@ -56,6 +56,13 @@ const stoneSyntax = defineSyntaxTheme({property: ['#4e6357', '#94b2a0'], // Teal T40 / T70punctuation: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70background: ['#f3f3f5', '#171719'],+ // Diff rows: the muted green/red at 25% in light and 20% in dark keep+ // every token at or above 4.5:1 on the tint; the markers are the tinted+ // text tokens (8.1:1 light, 8.8:1 dark on their tints).+ added: ['#d0e9ce40', '#b4cdb233'],+ removed: ['#f9dcd740', '#dcc0bc33'],+ 'added-marker': ['#374c36', '#d0e9ce'],+ 'removed-marker': ['#58413e', '#f9dcd7'],},});diff --git a/packages/cli/assets/templates/themes/y2k/y2kTheme.ts b/packages/cli/assets/templates/themes/y2k/y2kTheme.tsindex 771d696f29..b5a90f0928 100644--- a/packages/cli/assets/templates/themes/y2k/y2kTheme.ts+++ b/packages/cli/assets/templates/themes/y2k/y2kTheme.ts@@ -29,6 +29,14 @@ const y2kSyntax = defineSyntaxTheme({property: ['#3c6755', '#87b5a1'],punctuation: ['#5e5e5e', '#ababab'],background: ['#FFF6ED', '#190f00'],+ // Diff rows: the muted green/red at 25% in light and 20% in dark keep+ // every token at or above 4.5:1 on the tint. Markers: the tinted text+ // tokens in light (7.3:1 / 7.9:1); in dark those tokens are near-black,+ // so the string and tag colours mark the rows (5.1:1 each).+ added: ['#C5E17A40', '#C5E17A33'],+ removed: ['#FFC5C340', '#FFC5C333'],+ 'added-marker': ['#3a5500', '#a5af8b'],+ 'removed-marker': ['#8b1d24', '#d19f9d'],},});diff --git a/packages/themes/gothic/src/gothicTheme.ts b/packages/themes/gothic/src/gothicTheme.tsindex 82b6c4af27..740d15f534 100644--- a/packages/themes/gothic/src/gothicTheme.ts+++ b/packages/themes/gothic/src/gothicTheme.ts@@ -40,6 +40,15 @@ const gothicSyntax = defineSyntaxTheme({property: '#7cc5b3', // Verdigrispunctuation: '#7a8290', // Mid neutralbackground: '#101314',+ // Diff rows on the near-black background: any lighter wash lowers every+ // light token's contrast, so the rows take opaque hues at the+ // background's own luminance — a deep green and a deep red that read as+ // colour, not brightness — and every token keeps the contrast it has on+ // the plain background. Markers: forest moss and blood crimson.+ added: '#081408',+ removed: '#1e0a0a',+ 'added-marker': '#a3c987',+ 'removed-marker': '#d97580',},});diff --git a/packages/themes/stone/src/stoneTheme.ts b/packages/themes/stone/src/stoneTheme.tsindex 3f741a23db..4db4a099d8 100644--- a/packages/themes/stone/src/stoneTheme.ts+++ b/packages/themes/stone/src/stoneTheme.ts@@ -56,6 +56,13 @@ const stoneSyntax = defineSyntaxTheme({property: ['#4e6357', '#94b2a0'], // Teal T40 / T70punctuation: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70background: ['#f3f3f5', '#171719'],+ // Diff rows: the muted green/red at 25% in light and 20% in dark keep+ // every token at or above 4.5:1 on the tint; the markers are the tinted+ // text tokens (8.1:1 light, 8.8:1 dark on their tints).+ added: ['#d0e9ce40', '#b4cdb233'],+ removed: ['#f9dcd740', '#dcc0bc33'],+ 'added-marker': ['#374c36', '#d0e9ce'],+ 'removed-marker': ['#58413e', '#f9dcd7'],},});diff --git a/packages/themes/y2k/src/y2kTheme.ts b/packages/themes/y2k/src/y2kTheme.tsindex 771d696f29..b5a90f0928 100644--- a/packages/themes/y2k/src/y2kTheme.ts+++ b/packages/themes/y2k/src/y2kTheme.ts@@ -29,6 +29,14 @@ const y2kSyntax = defineSyntaxTheme({property: ['#3c6755', '#87b5a1'],punctuation: ['#5e5e5e', '#ababab'],background: ['#FFF6ED', '#190f00'],+ // Diff rows: the muted green/red at 25% in light and 20% in dark keep+ // every token at or above 4.5:1 on the tint. Markers: the tinted text+ // tokens in light (7.3:1 / 7.9:1); in dark those tokens are near-black,+ // so the string and tag colours mark the rows (5.1:1 each).+ added: ['#C5E17A40', '#C5E17A33'],+ removed: ['#FFC5C340', '#FFC5C333'],+ 'added-marker': ['#3a5500', '#a5af8b'],+ 'removed-marker': ['#8b1d24', '#d19f9d'],},});