-
Couldn't load subscription status.
- Fork 11
fix: correct theme initialization for classic and brand themes #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correct theme initialization for classic and brand themes #113
Conversation
✅ Deploy Preview for industrial-experience ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @alexkaduk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical theme initialization issues within the documentation site, which previously caused styling problems for developers, particularly those without corporate VPN access. By refactoring how themes are detected and applied in both Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively resolves the theme initialization problem by dynamically setting the theme based on the withBrandTheme flag, which is a significant improvement over the previous hardcoded approach. The changes in playground-context.tsx and SiteMetadata/index.tsx are logical and correctly implemented. I have one suggestion for SiteMetadata/index.tsx to refactor a block of code to make it more concise and maintainable. Overall, this is a well-executed fix.
|
The results for http://localhost:3000/docs/components/button/code are |
# Conflicts: # docs/components/event-list/code.mdx
…lexkaduk/ix-docs-fork into feature/IX-3496-classic-theme


Problem
The documentation site was hardcoding theme attributes to 'brand-dark',
which caused styling issues for developers. The existing
withBrandThemeflagwas being checked but never actually used to set initial theme values.
Root Causes
data-ix-theme="brand-dark"instead of conditionally setting based on
withBrandThemeflaginitialization and localStorage fallback
('brand-dark') while CSS expects new separated format
(
data-ix-theme="brand"+data-ix-color-schema="dark")Changes Made
src/theme/SiteMetadata/index.tsx
data-ix-theme="brand-dark"attribute toseparate
data-ix-themeanddata-ix-color-schemaattributesdata-ix-theme="classic"whenwithBrandThemeis falsemode toggle
src/context/playground-context.tsx
withBrandTheme ? 'brand' : 'classic'defaultThemevariabledefaultThemeto useEffect dependency arrayResults
✅ Developers now see properly styled components
(classic theme) instead of black/white
✅ Developers with VPN access continue to see brand theme as before
✅ Preview iframe buttons now visible with correct styling
✅ Code is future-proof using current CSS architecture (separate
theme and color-schema attributes)
✅ No package installations required - pure code fix
Testing
Tested in both scenarios:
Impact
This fix enables developers without VPN access to contribute to
documentation with properly styled local previews, while maintaining
full compatibility for developers with the corporate theme installed.