-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add separate dark theme color settings #12613
Add separate dark theme color settings #12613
Conversation
- Modifed the form to have two color fields (one for dark and one for light theme). - The colors are stored in this form"#ffffff,#000000". Where the first one is for light theme and the other for dark theme. - Then the custom.css consumes the values and performs a split(defined in custom_filters.py) on the color string to get the two colors. - Those colors then are defined in css variables and consumed by the elements that need them. - The css variables change base on the current theme (for dark values to be applied it is expected that the body tag has `data-theme="dark"`)
@nijel I am still working on this. I should add the |
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.
- Insure backward compatibility with previous theme color settings. - In the new implementation it considers if there was previous color settings. If so it applies them to dark theme colors too.
I currently don't see what might be causing that. Can we split this PR into two? One would introduce using variables in the custom CSS without doing any functional change and second would then add the dark theme customization? That way, we limit what might be causing the failures. |
Thanks for the suggestion. I'll go ahead and split the PR into two as you recommended. I'll first focus on the dark theme customization and then follow up with introducing the variables into the custom CSS in a separate PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12613 +/- ##
==========================================
+ Coverage 91.14% 91.16% +0.01%
==========================================
Files 596 596
Lines 60938 61216 +278
Branches 9646 6349 -3297
==========================================
+ Hits 55544 55807 +263
- Misses 3723 3757 +34
+ Partials 1671 1652 -19
|
This was used only in custom.css file. So no longer it is necessary in here
- The custom.css consumes the custom theme colors and use them. - Added a custom split filter for spliting the passed in 2 hex colors string. - Added tests. (depends on PR WeblateOrg#12613)
This commit fixes the test fails previously appeared. Mainly due to incorrect logic and use of incorrect color variables in the template. Changes: - Refactored custom.css and made CustomCssView handle custom theme settings instead of the css template. - also removed the no longer used custom_filters.py and test_custom_filters.py Dependes on PR: WeblateOrg#12613
@nijel this PR and #12794 are now finished. Also note they depend on each other.
The issues with the failing tests are resolved now. lol finally 🎉 |
* Add custom css dark theme customization - The custom.css consumes the custom theme colors and use them. - Added a custom split filter for spliting the passed in 2 hex colors string. - Added tests. (depends on PR #12613) * Fix test fails of custom.css theme settings This commit fixes the test fails previously appeared. Mainly due to incorrect logic and use of incorrect color variables in the template. Changes: - Refactored custom.css and made CustomCssView handle custom theme settings instead of the css template. - also removed the no longer used custom_filters.py and test_custom_filters.py Dependes on PR: #12613 * Add tests to split_colors Fixes #9372
Proposed changes
data-theme="dark"
)Closes: #9372
Checklist
Other information
Preview
Dark theme selected
Light theme selected