Skip to content

refactor(codehelp): theme-adaptive shared code theme#7969

Closed
talissoncosta wants to merge 6 commits into
mainfrom
spike/hljs-light-dark-6606
Closed

refactor(codehelp): theme-adaptive shared code theme#7969
talissoncosta wants to merge 6 commits into
mainfrom
spike/hljs-light-dark-6606

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Makes the shared highlight.js theme (_hljs.scss) theme-adaptive: code blocks follow light/dark via semantic tokens instead of always rendering dark. Shared app-wide, including the value editor.

  • Surface + syntax palette → semantic tokens (lifted from the onboarding code card)
  • .hljs--embedded for code inside a container that owns its surface; onboarding's card uses it and drops its overrides
  • CodeHelp/Highlight import Button instead of the global; adds CodeHelp stories for light/dark QA

Follow-ups: the scrollbar, header/button chrome, and value-editor input still carry dark styling.

How did you test this code?

  • CI visual-regression across light/dark, plus the CodeHelp stories in both themes. lint and typecheck pass.
  • Smoke test

Convert the shared highlight.js theme from its hardcoded dark palette to
semantic tokens, so code blocks adapt to light/dark instead of always rendering
dark. Code surface -> --color-surface-subtle; syntax colours -> the
--color-text-* palette (first pass, lifted from the onboarding code card).

Spike: .hljs is shared app-wide incl. the interactive value editor, so this is
a visible change everywhere. Opened to see the real diff via CI visual
regression before committing to a designed palette.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jul 15, 2026 6:04pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jul 15, 2026 6:04pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jul 15, 2026 6:04pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 68021674-3cd7-4d98-80f4-724a8000f014

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

talissoncosta and others added 2 commits July 8, 2026 16:45
Both were already won by the cascade: .select-language span.primary follows
.active at equal specificity, and code[contenteditable].hljs outranks .hljs. The
remaining !important beat highlight.js's own CSS / the Button / global resets.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Render CodeHelp with the real codeHelp snippets (install, init, create identity,
set traits) plus collapsed-header and embedded variants, so the shared code
block can be QA'd in light and dark (theme toggle) and across languages
(dropdown) in one place - the safety net for the #6606 theme change. Registers
window.Button in the Storybook preview, since CodeHelp uses the global Button
like Select.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
talissoncosta and others added 2 commits July 9, 2026 11:35
Adopt the onboarding code card's restrained palette (five semantic-token
groups, unmapped tokens inherit the base) as the shared `.hljs` theme, and
add a `.hljs--embedded` modifier for code that sits in a container already
providing the surface (transparent, no border/radius, gutter-reserved
scrollbar). Onboarding's bespoke .hljs block collapses to that one class.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…the global

Both reached for a bare `window.Button` (the legacy project-components.js
pattern) rather than importing it, which meant Storybook had to fake the
global. Import Button directly so they stand alone, and drop the shim from the
Storybook preview. Also de-nests Highlight's pre-existing html ternary into a
small helper so the touched file passes lint.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@talissoncosta talissoncosta changed the title refactor(styles): theme-adaptive shared code theme (.hljs) [spike #6606] refactor(codehelp): theme-adaptive shared code theme (.hljs) [spike #6606] Jul 15, 2026
@talissoncosta talissoncosta changed the title refactor(codehelp): theme-adaptive shared code theme (.hljs) [spike #6606] refactor(codehelp): theme-adaptive shared code theme Jul 15, 2026
@talissoncosta
talissoncosta deleted the spike/hljs-light-dark-6606 branch July 15, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant