fix(theme):refactor theme selectors to support both html and body#2357
fix(theme):refactor theme selectors to support both html and body#2357lakshmi-priya-b wants to merge 7 commits intomainfrom
Conversation
|
Summary of ChangesHello @lakshmi-priya-b, 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 a critical theming inconsistency where the 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.
Code Review
This pull request refactors the theme selectors to support applying themes to both the html and body elements, fixing an issue where theme toggling was not working correctly. The changes in packages/core/scss/theme/classic/theme.scss correctly add selectors for the html element. The fix is appropriate and addresses the problem described. I've included a couple of suggestions to improve the SCSS by using the :is() pseudo-class, which will make the selectors more concise and maintainable.
|
Updated CSS class-based theme deprecation from v4.0.0 to v5.0.0 in the ix-docs. |
There was a problem hiding this comment.
Refactoring the selector to target the HTML element will introduce other problems. Instead fix theme switcher itself.
There was a problem hiding this comment.
Code Review
This pull request refactors the theme switcher to use data attributes (data-ix-theme, data-ix-color-schema) on the <html> element for theme management, moving away from a purely class-based approach. This change fixes an issue with theme toggling. The logic is sound and the accompanying test updates correctly verify the new behavior. I've kept the suggestion to improve the efficiency of the toggleMode function by reducing redundant iterations over the element's class list, as it does not conflict with any provided rules.
|



💡 What is the current behavior?
GitHub Issue Number: #2326
🆕 What is the new behavior?
🏁 Checklist
A pull request can only be merged if all of these conditions are met (where applicable):
pnpm test)pnpm lint)pnpm build, changes pushed)👨💻 Help & support