-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Expose default theme in meta and API #13809
Conversation
Signed-off-by: jolheiser <[email protected]>
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.
This is default theme, we should report what the user’s current theme is as well
@techknowlogick That could be another PR. :) |
A separate meta tag (that would only show up when the user is signed it)? |
What is use case for default theme in meta tag as we don't use it in javascript? |
Default theme is probably fine, but please don't do user's theme. I plan on moving the user's theme setting to JavaScript (e.g. removing it from the database and having it in localStorage only) later.
Theme is already a className on the HTML tag, isn't that enough? |
Thought, I'm not sure yet how to do the theme loading is JS because accessing localStorage during page load will be problematic (requires inline script), so we might end up keeping the theme in the database after all. |
🚀 |
We'll remove this meta tag in #24960, it is non-standard and does not reflect current theme, just the server's default, so it was never accurate. I don't know what "dark reader" the original PR is refering to, but it's not the official one. Such extensions should either check the standard
gitea/web_src/css/themes/theme-arc-green.css Line 185 in 7314726
|
As title, this was requested in Discord primarily for a dark reader to be able to check the DOM for the default theme.
As well, this adds the default theme to the UI API.