feat: code sample dark theme variant#340
Merged
greatest0fallt1me merged 3 commits intoJun 29, 2026
Merged
Conversation
- Add collapsible filter sections (Categories, Price, Popularity) - Persist collapsed state to localStorage via usePersistedState hook - Add ChevronIcon component for expand/collapse indicator - Implement WCAG 2.1 AA accessibility with aria-expanded/aria-controls - Add reduced motion support and responsive styling - Add comprehensive tests for collapse functionality closes CalloraOrg#254
- Add snapshotUrl.ts utility for URL-based endpoint sharing - Add Share Snapshot button to generate/copy shareable URLs - Restore endpoint params from URL on page load - Add LinkIcon component for share functionality - Handle Unicode chars in params via base64 encoding closes CalloraOrg#252
|
@vicky4196 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
- Extract inline styles to code.css with CSS custom properties - Add dark theme variants via [data-theme="dark"] selector - Use design tokens: bg-subtle, bg-highlight, border-subtle, text-main - Add reduced motion support and sr-only utility - Refactor CodeExample to use semantic CSS classes closes CalloraOrg#243
d982f7b to
080eedf
Compare
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.
Add code-sample dark theme variant
Summary
This PR adds dark theme CSS variants for the CodeExample component. Code samples now respect CSS custom properties with proper light/dark theme overrides, ensuring visual parity across both modes.
Changes
src/styles/code.css(new)--bg-subtle,--bg-highlight,--border-subtle,--text-main,--font-mono)[data-theme="dark"]overrides for dark mode parity.code-sample__tabstyles with active state.code-sample__prestyles for code display.sr-onlyutility class for screen reader announcementsprefers-reduced-motionsrc/components/CodeExample.tsx../styles/code.csspreview-cardwithcode-samplewrapper classcode-sample__header,code-sample__tabs,code-sample__tab,code-sample__tab--active,code-sample__panel,code-sample__pre<style>block, now uses external CSSsrc/components/CodeExample.test.tsx.code-sampleclass)CSS Custom Properties
--bg-subtle#f9f9f9rgba(255, 255, 255, 0.03)--bg-highlight#ffffffvar(--surface-strong)--border-subtle#e2e8f0var(--line)--text-main#1a2332var(--text)--font-monoAccessibility (WCAG 2.1 AA)
var(--accent)for keyboard navigationprefers-reduced-motionsupport for users who request reduced motion.sr-onlyTest Output
All tests pass including:
closes #243