mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-22 14:34:54 -05:00
Reduce palette size of themes #8805
Open
opened 2025-11-02 08:19:10 -06:00 by GiteaMirror
·
15 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.16.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.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#8805
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @clarfonthey on GitHub (Apr 9, 2022).
Feature Description
Right now, the
_base.lessfile defines all of the colours for the base theme (which is overridden for the dark theme), and the current palette size is… 121 colours, with 105 unique colours; some are duplicated but not referencing each other.Honestly, I'd say it's a big stretch that this should be larger than 20, but the exact number isn't nearly as important. We definitely have too many.
Auditing things like colour contrast is basically not possible with this many combinations, and if someone wants to make simple changes (e.g. changing just the accent colour), this isn't really feasible, since there are so many different shades of each colour.
I think it's extremely worthwhile seeing what can be trimmed from the palette by either using a similar shade or opacity to blend with the background (in cases like the heatmap).
Screenshots
No response
@silverwind commented on GitHub (Apr 11, 2022):
Generally, I find needing at least 10 shades per color to have enough fine-grained control. The alpha shades we can probably eliminate.
If you take a look at GitHub's CSS, I think they have now around 500 colors, so I assume it's pretty normal to end up with many colors as projects grow.
Also, we must consider not needlessly renaming/adding CSS variables as it will break 3rd party themes. Removal should generally be fine.
@clarfonthey commented on GitHub (Apr 12, 2022):
I agree with needlessly eliminating variables but disagree completely with the required number of shades. At a minimum, since the stylesheet is using LESS, it should be computing required shades if necessary rather than hard-coding them, since it makes it difficult to discern what would need to be changed in case someone wanted to modify the colours.
@silverwind commented on GitHub (Apr 12, 2022):
Computing colors in LESS is something I certainly want to avoid because those variables can not be interacted with at runtime (we already do that as part of the monaco themeing) and it makes 3rd party theming a lot more complex as they'd need to depend on our LESS sources. Imho, variables inside the styling must strictly stay custom properties.
CSS custom properties integrate much better than preprocessor variables. It's a shame that standard CSS still does not offer a way to modify colors at runtime, but there have been some recent proposals for just that in W3C, so maybe we'll get something in 5-10 years.
@clarfonthey commented on GitHub (Apr 12, 2022):
I think you're misunderstanding what I'm saying-- take the existing CSS variable definitions and replace the actual colours with versions computed using LESS functions. If you reference the compiled CSS, you'll still have static colours, but if you reference the LESS, you'll know where the colours came from.
@silverwind commented on GitHub (May 2, 2023):
We've migrated from Less to CSS now. Once color-mix is well supported in browsers, it can be used to reduce the number of colors, but I take it will be a year or two until that point.
@clarfonthey commented on GitHub (May 3, 2023):
This still doesn't respond at all to the argument that the stylesheet could due with substantially fewer shades than it has.
If we're talking about super-granular case like the heatmap in user profiles, this could easily be accomplished today with
opacityinstead of explicitly setting the background to a mixed colour. In all other cases, I still strongly disagree that a large number of shades are needed for standard UI elements; even a user with very good vision would be hard-pressed to identify ten different shades of a colour on all the standard UI elements, and much more than four is really pushing it.I mentioned using LESS as a starting point for this issue, not the ending point.
@wxiaoguang commented on GitHub (May 3, 2023):
I agree that there are too many colors. Is there a feasible plan about how to clean them up?
@wxiaoguang commented on GitHub (May 3, 2023):
And actually, I have slight objection for such UI ( #22864) , I am not a fan of making UI too colorful .....
It's better to have some widely-accepted UI design patterns.
@clarfonthey commented on GitHub (May 3, 2023):
Another big reason against those kinds of changes is that the contrast tends to be rather poor. For example, the contrast between the red and green in the bar next to "README.md" there is effectively zero if you're red-green colourblind, and the contrast between the yellow text and the white background is also very poor.
This is also the main reason why I disagree with so many shades of colours. For example, the background colour of the header for the file element is #f7f7f7, and the colour of the main background is #ffffff. This is such a low contrast that it's effectively invisible even for someone with a good monitor and good vision. This colour should be reduced to a darker shade or replaced with the original colour.
Like I said, I struggle to believe any argument that claims that 10 shades of a colour is a good baseline for stylesheets. Can you reasonably come up with a layout where all 10 of those shades are both used, and looks at least subjectively better than a version with fewer shades? Not only does a large number of shades make it very difficult for people who want to adopt the theme for themselves, but it also just leads to a sloppy design language where people don't really know what shades are appropriate for various UI elements.
@wxiaoguang commented on GitHub (May 3, 2023):
Luckily, the green-red gauge only provides some minor information, it only makes the UI looks slightly beautiful.
The real problem for me here is the orange color, I am the poor man who doesn't have a good monitor / good vision .... it's difficult for me to read how many files get changed at first glance .... 🤔
@wxiaoguang commented on GitHub (May 4, 2023):
@clarfonthey Now there are new requirements for colors (focus/active), do you have more ideas about it? #24507
@silverwind commented on GitHub (May 4, 2023):
These are indiscussable I'd say. Fomantic UI has 4 different color shades for each button color, if we don't overwrite all, inconsistent colors will show up on buttons like it currently does for
:focusand:activestates.@clarfonthey commented on GitHub (May 4, 2023):
The discussion is about whether different states should be different colours, not whether we should set the colours in the CSS. I think we're both with you on making sure they actually follow the theme correctly, but the question is what the theme should be in the first place.
@silverwind commented on GitHub (Jun 29, 2023):
Interesting tidbit, number of color variables comparing GitHub and Gitea. GitHub has major spaghetti going on in their CSS variables, we are not nearly at that point, thankfully.
GitHub
Gitea
@silverwind commented on GitHub (Mar 28, 2024):
Will be fixed with https://github.com/go-gitea/gitea/issues/30160 which will give us total color freedom.