-
-
Notifications
You must be signed in to change notification settings - Fork 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
Separate color settings for dark theme in apepearance customization #9372
Comments
This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this. You can learn about how to get started in our contributors documentation. |
@nijel I'm assuming this has been solved given your update a few weeks ago? I noticed the current solution is to load the dark css file unless the user has set the theme setting to light, nearly doubling the css load time for the default setting and 2/3 of the total options. The change also does therefore not take place until after settings page reload. Would a better solution not be to get rid of the dark css file and alter the original css file to use custom properties for different theme on the :root? - See Codepen / sc Similar implementation of the js on #switcher in the example could be implemented on clicking save in the settings menu so change takes place immediately rather than on page reload. Then on page reload you would use the same logic as you currently use but instead of the settings change deciding whether a stylesheet is included it would just load the html tag with a data-theme attribute for their choice. If they select auto on settings load it without the attribute and the @media prefers dark kicks in if this is their system setting. Alternatively store the setting in storage and negate the need for the if statement in the html file at all, if they switch browsers and the value cant be found then get it from the backend. Let me know if this is still an open issue that needs contribution or if there's a reason you decided to go the route that you have rather than this approach I'd appreciate some insights as to why so I can continue to learn. |
@mjp-riley This issue is about supporting appearance customization in the dark theme. Rigth now there is a single customization option which applies to both dark and light themes.
The dark theme is loaded only if the user agent prefers a dark theme using media query. Using variables would make things definitely easier, but Bootstrap 3 (which we currently use) is not really ready for this. There is an issue for upgrading, but nobody is working on it: #2916 |
@meel-hd this will need a backend changes as well, but I think we could start with using CSS variables for the existing customization and then build the dark theme customization on top of that? |
I don't think we have to change the backend for persisting each user's preferred theme. By default, the first time a user loads the app we select either light, dark, or based on the system theme. Then later he can change that based on his preference and we store that in local storage. |
This is not for persisting user theme, this is for customizing color theme for Weblate instance. You can access it at |
Very limited docs is here: https://docs.weblate.org/en/latest/admin/admin.html#manage-appearance |
* 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
Thank you for your report; the issue you have reported has just been fixed.
|
Describe the problem
Currently, the color settings are the same for light and dark theme. There should be separate color settings for dark and light theme.
Describe the solution you'd like
Ability to change the color of each theme.
Describe alternatives you've considered
No response
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: