Uh oh!
There was an error while loading. Please reload this page.
[WIP] fix: address accessibility issue with dark theme using token background colors - #6847
Conversation
|
…s with design tokens Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
1 similar comment
size-limit report 📦
|
4ad5155
into
chore/add-portal-contextUh oh!
There was an error while loading. Please reload this page.
This pull request introduces a new
PortalContextto the@primer/reactlibrary, allowing more flexible and context-driven control over where portal content is rendered. The changes include updates to the corePortalcomponent, its exports, new Storybook examples, and additional tests to ensure correct behavior when usingPortalContextand container overrides.Changelog
New
PortalContexttoPortal.tsx, allowing consumers to specify aportalContainerNamevia React context, which determines the portal root container for content rendering. ThePortalcomponent now prioritizes the context value unless overridden by its owncontainerNameprop.Portal.test.tsxto verify correct portal rendering behavior when usingPortalContext, including context-only, default fallback, undefined context, and prop override scenarios.WithPortalContext) inPortal.features.stories.tsxto demonstrate how to usePortalContextfor controlling portal rendering, including context and prop override cases.Changed
index.tsand the package entry point to includePortalContext, making it available for consumers.WithPortalContextStorybook story by replacing hardcoded background and border colors with proper Primer design tokens, ensuring the story adapts correctly to both light and dark themes with excellent color contrast.Removed
Rollout strategy
Testing & Reviewing
Accessibility Fix
The Portal context story previously used hardcoded colors (
#f0f8ff,#e6f3ff, etc.) that didn't adapt to dark theme, causing accessibility issues. This has been resolved by:var(--bgColor-accent-muted),var(--bgColor-attention-emphasis), etc. for backgroundsvar(--borderColor-*-emphasis)for bordersvar(--fgColor-onEmphasis)for proper text contrast on emphasis backgroundsScreenshots:
Merge checklist
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.