feat: add auto theme functionality to OverType editor#100
Open
dido739 wants to merge 9 commits intopanphora:mainfrom
Open
feat: add auto theme functionality to OverType editor#100dido739 wants to merge 9 commits intopanphora:mainfrom
dido739 wants to merge 9 commits intopanphora:mainfrom
Conversation
- Implemented auto theme switching based on system color scheme preference. - Added `auto` theme to themes registry, defaulting to solar colors. - Enhanced `setTheme` method to handle auto theme and resolved theme application. - Introduced media query listeners for real-time theme updates. - Updated example pages to demonstrate auto theme functionality. - Created tests for auto theme behavior at both instance and global levels.
Co-authored-by: dido739 <152557154+dido739@users.noreply.github.com>
Co-authored-by: dido739 <152557154+dido739@users.noreply.github.com>
Co-authored-by: dido739 <152557154+dido739@users.noreply.github.com>
Co-authored-by: dido739 <152557154+dido739@users.noreply.github.com>
Co-authored-by: dido739 <152557154+dido739@users.noreply.github.com>
…-size Optimize auto theme bundle size by 0.90 KB
Author
|
Update: After some work with Copilot I've managed to save ~0.9KB, using some optimizations. |
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.
Hi guys. Yesterday I stumbled upon #84 and decided to do something.
This is what I did:
autotheme to themes registry, defaulting to solar colors.setThememethod to handle auto theme and resolved theme application.Screenshots form the auto theme:
P.S. Unfortunately the size increased from ~95KB to ~98KB. It could probably be optimized. I'm open to suggestions.
Summary by cubic
Adds an auto theme that matches the system light/dark setting and switches in real time. Works per-instance and globally via OverType.setTheme('auto'), with optimized listeners, DOM updates, and web component refreshes.
Written for commit f8d77e3. Summary will update on new commits.