Skip to content

refactor(styles): theme-adaptive shared code theme (.hljs) [spike #6606]#7969

Draft
talissoncosta wants to merge 3 commits into
mainfrom
spike/hljs-light-dark-6606
Draft

refactor(styles): theme-adaptive shared code theme (.hljs) [spike #6606]#7969
talissoncosta wants to merge 3 commits into
mainfrom
spike/hljs-light-dark-6606

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Draft / spike for #6606 — not for merge as-is. Opened to see the real app-wide diff via CI visual regression.

What

Converts the shared highlight.js theme (web/styles/3rdParty/_hljs.scss) from its hardcoded dark palette to semantic tokens, so code blocks adapt to light/dark instead of always rendering dark.

  • Code surface: $code-bg--color-surface-subtle
  • Syntax colours → --color-text-{action,success,info,secondary,default} (first-pass mapping, lifted from the onboarding code card)

Why a spike, not a ready PR

.hljs is shared app-wide, including the interactive value editor (flag values / segments / identities), so this is a visible change on every code block and the value editor in light mode (~15 surfaces). This PR exists to review the real diff before committing to a designed palette.

Before this is real

  • The syntax palette is a 4-token simplification; the theme has more distinctions (bullet / params / type / subst…) that may deserve their own tokens.
  • Value-editor + header/button chrome ($code-btn-*, $primary900, code.txt) still carry dark styling — not yet converted.
  • QA both modes across all surfaces; the CI visual-regression report is the guide.

Refs #6606

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 8, 2026 7:50pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jul 8, 2026 7:50pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jul 8, 2026 7:50pm

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: c663ea99-eb19-42cf-9c57-f17dcbf1544f

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>
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