fix(NcAppNavigationItem): Make active state darker than hover#8533
fix(NcAppNavigationItem): Make active state darker than hover#8533nfebe wants to merge 1 commit into
Conversation
nfebe
left a comment
There was a problem hiding this comment.
Pointing out this was what already existed before @susnux pushed against it via reviews in #8448 (NcListItem a11y concern) (#8448 (comment)) and #8448 (NcAppNavigationItem follow-up) (#8448 (comment)).
So reverted as it matches @kra-mo's request in #8526 ("darker and not opaque").
The argument about contrast not being guaranteed is not accurate because the active bg is 84% transparent over --color-main-background; what shows through dominates the visible surface, and the text is rendered with --color-main-text -- the NC-guaranteed contrast pair.
The selected nav item appeared lighter than the hovered one in the new NC34+ design. Use a semi-transparent darker overlay so the active state sits visually below hover, matching the mockup intent. Refs #8526 Signed-off-by: nfebe <fenn25.fn@gmail.com>
1086553 to
fb9b34b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## stable8 #8533 +/- ##
========================================
Coverage 46.85% 46.85%
========================================
Files 195 195
Lines 4926 4926
Branches 1205 1268 +63
========================================
Hits 2308 2308
+ Misses 2531 2529 -2
- Partials 87 89 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Could you also provide screenshots on:
We now have more and more new/updated UI components with new colors that are dynamically computed with different formulas in different places. It not only makes it hard for maintenance and keeping colors consistent across different places but also for testing (each time we need to make sure it is accessible and supports Nextcloud themes and Nextcloud theming). @kra-mo Can we have a new palette with the new colors? |
I mean, I don't think more and more color variables would make sense. Computing colors from each other is nicer, but they should be based on constraints and logic, especially when it comes to transparency, which I think we've been underutilizing in general in favor or solid colors. Like a lot of hover and border colors right now are hardcoded solid ones, which start looking off as soon as you put them over anything other than the default background color (in this case, the sidebar). I think this may warrant a bigger discussion, possibly also tying into OKLCH? |
Computing colors doesn't conflict with having them in the theming palette. We already do it. For example, we have What is missing is a specific semantic named value in the theme. The problem is reinventing the computation/color in many individual places. It results in:
My experience with OKLCH wasn't good. While in theory it should work better, the colors often looked worse than with simpler HSL manipulation. But how exactly we compute (PHP, CSS, a-channel, OKLCH) doesn't matter. |
|
Ok, let's set aside the topic of computed colors broadly. This hover color should be consistent across all elements that are neutral/derived from primary, which means we should find some color to consistently mix with everything. Primary, secondary, as well as tertiary-colored, including transparent controls should all look similar when hovered, which means in this case, the hover color of tertiary elements (which should be without a background), which should be semitransparent instead of opaque. Let's say that all hovered elements tend toward some mix of fg + primary. Maybe 70% fg, 30% primary (depends on the color space). Let's call this the hover "shade". So all elements' hover color would be mixed with this shade. Let's say primary's hover color would be primary + 20% shade, secondary's would be secondary + 15% shade and transparent controls' would be transparent + 10% shade (so shade at 10% opacity). Does that make sense? I'm not sure I explained it well. |

The selected nav item appeared lighter than the hovered one in the new NC34+ design. Use a semi-transparent darker overlay so the active state sits visually below hover, matching the mockup intent.
Resolves #8526
🖼️ Screenshots