refactor(codehelp): theme-adaptive shared code theme#7969
Closed
talissoncosta wants to merge 6 commits into
Closed
refactor(codehelp): theme-adaptive shared code theme#7969talissoncosta wants to merge 6 commits into
talissoncosta wants to merge 6 commits into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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>
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>
4 tasks
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/if required so people know about the feature.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..hljs--embeddedfor code inside a container that owns its surface; onboarding's card uses it and drops its overridesCodeHelp/HighlightimportButtoninstead of the global; adds CodeHelp stories for light/dark QAFollow-ups: the scrollbar, header/button chrome, and value-editor input still carry dark styling.
How did you test this code?
lintandtypecheckpass.