-
-
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
Add gitea-dark theme #12448
Add gitea-dark theme #12448
Conversation
Imho we should move out colors to less variables like ($text-color, $link-color, $button-background-color etc) that could be tuned than for different themes |
@silverwind the message text in |
I like the dark theme but I think we should keep less themes to maintain easier. Currently we have two internal themes, if we merge this, we will have three. Every PR which will add a new feature(i.e. board) have to change the three themes. Maybe we should add a theme market feature and the site related #7903 |
Less variables are only changeable at build time, not at runtime. I'd be much better to use CSS variabled (custom properties) which can be modified at runtime but I guess that could also be material of another PR.
I'm not sure yet what to do about arc-green but I imagine we could eventually phase it out or move it to the automated approach with the color remapping. Maintaining these theme will be less work than it currently is where you need to copy every color-affecting selector to arc-green because as long as no new colors are introduced, the build mechanism will automatically generate the selectors for you.
A noble idea but I think it's currently unfeasible because manually created themes would need constant maintenance to be kept up to date with changes in the base theme. This might become feasible once we move all colors to CSS varibles, but currently it isn't. |
@silverwind yes but this way we can build multiple themes by just specifying different variable colors. Also we can specify them to css variables to get them changeable at runtime (auto dark theme) |
CSS vars can do most of the things that Less vars can do, I see no benefit in using Less vars. We can define a set of base vars in the default theme, to be overridden in each theme individually. There is one major problem which is Fomantic hardcodes all their colors so the approach can not properly work unless we fork Fomantic's CSS (which is horribly over-complicated) or generate the gitea theme using the ThemeBuilder mechanism too (I think the latter is the way to go). |
@bagasme fixed that: |
Can't see any more obvious issues, so ready for review. |
Maybe should label this as a feature. I'll do another pass on this shortly. |
Codecov Report
@@ Coverage Diff @@
## master #12448 +/- ##
==========================================
+ Coverage 43.76% 43.77% +0.01%
==========================================
Files 631 631
Lines 69870 69870
==========================================
+ Hits 30580 30587 +7
+ Misses 34338 34331 -7
Partials 4952 4952
Continue to review full report at Codecov.
|
Theme is now completely running on CSS vars. |
Will do a few more tweaks later. If anyone has feedback on the CSS variable approach, it'd be welcome. The variable naming is certainly not ideal and I'm contemplating using shorter names like I imagine we can switch the base theme to the same approach using |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
Will probably follow up on this later once we have converted everything to CSS vars. |
Second take on a general dark theme that is close to an inversion of the gitea theme. This is not quite ready yet but good enough for a preview.
The way it work is it hooks into webpack's output to grab index.css, remap all colors within to dark colors and prepend the result to the theme file. One benefit of this method is is that maintainers generally don't need to touch the theme as long a they are using colors already present on the page.
The hook may fail on watch mode builds after the first, I will look into possible solutions. Also, lazy-loaded chunks like dropzone are not handled yet.