Skip to content

fix(apollo-wind): complete future-dark and future-light CodeBlock theme integration#772

Draft
1980computer wants to merge 3 commits into
mainfrom
fix/code-block-themes
Draft

fix(apollo-wind): complete future-dark and future-light CodeBlock theme integration#772
1980computer wants to merge 3 commits into
mainfrom
fix/code-block-themes

Conversation

@1980computer

Copy link
Copy Markdown
Collaborator

Summary

Completes the CSS custom property integration for the future-dark and future-light themes in CodeBlock. These were the only two themes where bg used a CSS variable (var(--surface-raised)) while the remaining four values stayed hardcoded — creating an inconsistent mix that wouldn't adapt if token values changed.

All five values now pull from Apollo design tokens:

Value future-dark future-light
bg var(--surface-raised) — zinc-900 var(--surface-raised) — zinc-100
headerBg var(--surface) — zinc-950 var(--surface-overlay) — zinc-200
labelColor var(--foreground-muted) — zinc-400 var(--foreground-muted) — zinc-500
iconColor var(--foreground-subtle) — zinc-500 var(--foreground-subtle) — zinc-400
lineNumberColor var(--ap-wind-border) — zinc-700 var(--ap-wind-border) — zinc-300

The headerBg fix also corrects a visual bug in future-light where the header and body were both zinc-100 — indistinguishable from each other. The header is now zinc-200, one step deeper.

No changes to the other 7 themes (dark, light, dark-hc, light-hc, wireframe, vertex, canvas).

Test plan

  • Open the CodeBlock story and switch the Storybook theme to Future Dark — verify header is visibly darker than body, label/icon/line numbers render correctly
  • Switch to Future Light — verify header is visibly distinct from body (zinc-200 vs zinc-100), label/icon/line numbers render correctly
  • Switch between all other themes — confirm no visual regressions
  • Confirm no CI failures

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 3, 2026 16:12
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-design 🟢 Ready Preview, Logs Jun 12, 2026, 10:33:53 AM
apollo-docs 🟢 Ready Preview, Logs Jun 12, 2026, 10:33:53 AM
apollo-landing 🟢 Ready Preview, Logs Jun 12, 2026, 10:33:53 AM
apollo-vertex 🟢 Ready Preview, Logs Jun 12, 2026, 10:33:53 AM

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1938 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1708
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the token-based theming for the CodeBlock component’s future-dark and future-light variants by replacing remaining hardcoded hex colors with semantic CSS custom properties, aligning these themes with how Apollo Wind’s semantic tokens are intended to adapt across theme definitions.

Changes:

  • Updated future-dark theme colors (headerBg, labelColor, iconColor, lineNumberColor) to use semantic CSS variables.
  • Updated future-light theme colors similarly, including switching headerBg to --surface-overlay to ensure header/body separation.

@1980computer 1980computer force-pushed the fix/code-block-themes branch from 7bf506c to 4bc30df Compare June 4, 2026 14:24
Copilot AI review requested due to automatic review settings June 4, 2026 14:31
@1980computer 1980computer force-pushed the fix/code-block-themes branch from 4bc30df to 805c054 Compare June 4, 2026 14:31
@github-actions github-actions Bot added size:L 100-499 changed lines. and removed size:S 10-29 changed lines. labels Jun 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment on lines +207 to +211
bg: '#18181b', // zinc-900
headerBg: '#09090b', // zinc-950 — one step deeper than body
labelColor: '#a1a1aa', // zinc-400
iconColor: '#71717a', // zinc-500
lineNumberColor: '#3f3f46', // zinc-700
Comment on lines +216 to +220
bg: '#f4f4f5', // zinc-100
headerBg: '#e4e4e7', // zinc-200 — one step deeper than body
labelColor: '#71717a', // zinc-500
iconColor: '#a1a1aa', // zinc-400
lineNumberColor: '#d4d4d8', // zinc-300
Comment on lines +74 to +78
// future-dark: zinc palette backgrounds, cyan keywords, emerald strings,
// amber numbers, violet literals — matching the Apollo Future dark token spec.
const apolloFutureDark = {
'code[class*="language-"]': { color: '#a1a1aa', background: 'none' }, // zinc-400 --code-rest
'pre[class*="language-"]': { color: '#a1a1aa', background: 'none' },
@1980computer 1980computer force-pushed the fix/code-block-themes branch 2 times, most recently from f20ed45 to 5f7aed8 Compare June 4, 2026 14:42
Copilot AI review requested due to automatic review settings June 4, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Comment on lines 205 to 212
'future-dark': {
prismStyle: vscDarkPlus,
bg: 'var(--surface-raised)',
headerBg: '#09090b',
labelColor: '#a1a1aa',
iconColor: '#71717a',
lineNumberColor: '#3f3f46',
prismStyle: apolloFutureDark,
bg: '#18181b', // zinc-900 surface-raised
headerBg: '#09090b', // zinc-950 surface — one step deeper than body
labelColor: '#a1a1aa', // zinc-400 --code-rest / foreground-muted
iconColor: '#71717a', // zinc-500 foreground-subtle
lineNumberColor: '#52525b', // zinc-600 matches comment colour — most muted code text
},
Comment on lines 214 to 221
'future-light': {
prismStyle: vs,
bg: 'var(--surface-raised)',
headerBg: '#f4f4f5',
labelColor: '#52525b',
iconColor: '#71717a',
lineNumberColor: '#d4d4d8',
prismStyle: apolloFutureLight,
bg: '#f4f4f5', // zinc-100 surface-raised
headerBg: '#e4e4e7', // zinc-200 surface-overlay — one step deeper than body
labelColor: '#71717a', // zinc-500 foreground-muted
iconColor: '#a1a1aa', // zinc-400 foreground-subtle
lineNumberColor: '#a1a1aa', // zinc-400 matches comment colour — most muted code text
},
Comment on lines +269 to +276
// Themes that have CSS custom-property scoping via a class name on the element.
// When an explicit `theme` prop is passed we wrap the component in a div carrying
// that class so that `future:` Tailwind variants and CSS vars resolve correctly
// regardless of the page's global theme.
const THEME_SCOPE_CLASS: Partial<Record<CodeBlockTheme, string>> = {
'future-dark': 'future-dark',
'future-light': 'future-light',
};
Comment on lines +383 to +388
// When an explicit future theme is passed, wrap in its scope class so that
// `future:` Tailwind variants and CSS custom properties resolve correctly
// regardless of the page's global theme.
const scopeClass = theme ? THEME_SCOPE_CLASS[theme] : undefined;

const block = (
@1980computer 1980computer force-pushed the fix/code-block-themes branch from 5f7aed8 to c184c3b Compare June 4, 2026 14:56
@github-actions github-actions Bot added size:XL 500-999 changed lines. and removed size:L 100-499 changed lines. labels Jun 4, 2026
Comment thread packages/apollo-wind/src/components/ui/code-block.stories.tsx Fixed
Comment thread packages/apollo-wind/src/components/ui/code-block.stories.tsx Fixed
Copilot AI review requested due to automatic review settings June 4, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +207 to +211
bg: '#18181b', // zinc-900 surface-raised
headerBg: '#09090b', // zinc-950 surface — one step deeper than body
labelColor: '#a1a1aa', // zinc-400 --code-rest / foreground-muted
iconColor: '#71717a', // zinc-500 foreground-subtle
lineNumberColor: '#52525b', // zinc-600 matches comment colour — most muted code text
Comment on lines +216 to +220
bg: '#f4f4f5', // zinc-100 surface-raised
headerBg: '#e4e4e7', // zinc-200 surface-overlay — one step deeper than body
labelColor: '#71717a', // zinc-500 foreground-muted
iconColor: '#a1a1aa', // zinc-400 foreground-subtle
lineNumberColor: '#a1a1aa', // zinc-400 matches comment colour — most muted code text
Comment on lines +383 to +387
// When an explicit future theme is passed, wrap in its scope class so that
// `future:` Tailwind variants and CSS custom properties resolve correctly
// regardless of the page's global theme.
const scopeClass = theme ? THEME_SCOPE_CLASS[theme] : undefined;

Comment on lines +402 to +405
// eslint-disable-next-line @typescript-eslint/no-explicit-any
monaco.editor.defineTheme('apollo-future-dark', apolloFutureDarkMonaco as any);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
monaco.editor.defineTheme('apollo-future-light', apolloFutureLightMonaco as any);
* import { EditorView } from '@codemirror/view';
* import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
* import { tags as t } from '@lezer/highlight';
* import { apolloFutureDarkCodeMirror } from '@uipath/apollo-wind/editor-themes/codemirror';
Comment on lines +23 to +24
// Monaco rule foreground values are hex WITHOUT the leading '#'.
// Monaco colors values are hex WITH the leading '#', and support 8-char #rrggbbaa.
Comment on lines +50 to 54
"./editor-themes": {
"import": "./dist/editor-themes/index.js",
"require": "./dist/editor-themes/index.cjs",
"types": "./dist/editor-themes/index.d.ts"
}
1980computer and others added 3 commits June 11, 2026 12:45
…es to Apollo CSS tokens

Replaces the four hardcoded hex values in each future theme config with
the correct Apollo CSS custom properties:

- headerBg: var(--surface) / var(--surface-overlay) — one step deeper than
  the body background, creating header separation
- labelColor: var(--foreground-muted) — filename / language label
- iconColor: var(--foreground-subtle) — copy button icon
- lineNumberColor: var(--ap-wind-border) — gutter numbers

bg was already using var(--surface-raised) in both themes; the rest were
hardcoded zinc hex values that didn't adapt with the live theme system.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e Block IA

Adds two dedicated story pages — Monaco Editor and CodeMirror Editor — each
with live dark/light editor instances using the Apollo Future theme adapters.
Restructures the Code Block section so the three solutions (CodeBlock display,
Monaco, CodeMirror) are clearly separated with their own pages.

- Code Editors page: trimmed to overview only (decision table + orchestrator
  pattern). No live demos — each editor has its own page.
- Monaco Editor page: live TypeScript editor, dark + light, with usage snippet
- CodeMirror Editor page: live expression editor, dark + light, with usage
  snippet
- Docs page: component description callout clarifying CodeBlock is read-only
  and pointing consumers to the editor pages
- Installs @monaco-editor/react, monaco-editor, @codemirror/* as devDeps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…component

- Remove CodeBlock component from apollo-wind public API
- Move Monaco and CodeMirror to optional peerDependencies
- Rename story section from Experiments to Patterns
- Move Layout Generator to Templates/Future
- Restructure Code Editors stories: Overview, Editor Monaco, Editor CodeMirror, Themes
- Remove autodocs from Code Editors; replace CodeBlock usage with plain pre elements
- Repurpose Themes story to show Monaco + CodeMirror theme previews
- Fix Storybook Vite optimizeDeps: exclude monaco-editor from bundling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@1980computer 1980computer force-pushed the fix/code-block-themes branch 2 times, most recently from bea8f52 to 936dd79 Compare June 12, 2026 17:27
@github-actions github-actions Bot added app:storybook size:XXL 1,000+ changed lines. and removed size:XL 500-999 changed lines. labels Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants