Repository navigation
Fix / INT-744 / Keep dark gray tints one step off the panel surface - #55
RobinAtherton wants to merge 4 commits into
Conversation
secondary.subtle/muted/emphasized and Chakra's gray.* read gray.900/800/700 in dark mode, but surfaces (bg.panel) are gray.900, so hover, selected and divider tints on cards and the sidebar were invisible. The dark ramp now starts at gray.800. Light values are unchanged. Also replaces the deprecated shell.* placeholder note with the tokens to use instead, and adds a system test that fails if any gray tint equals bg.panel or bg in dark mode.
aslamshah-hivemq
left a comment
There was a problem hiding this comment.
LGTM. I will check the other theme pr
aslamshah-hivemq
left a comment
There was a problem hiding this comment.
Moving the dark gray tints off bg.panel makes sense. One dark-mode regression to fix before merging, plus a test note, see inline.
| describe('Dark mode layering', () => { | ||
| // A hover, selected or divider tint that equals the surface it sits on is invisible. Surfaces | ||
| // are `bg.panel` in dark mode, so every gray-scale tint has to differ from it (and from the page). | ||
| const grayTints = ['secondary', 'gray'].flatMap((palette) => |
There was a problem hiding this comment.
Chakra's bg.subtle, border.subtle and border.muted have the same problem: they match the page or panel color in dark mode, and partly in light mode. This was already the case before this PR, so it could be a follow-up, but worth adding to this list.
Also, the test compares var(...) strings, so a token that points at bg.panel through an alias would still pass.
There was a problem hiding this comment.
Fine to leave this for a follow-up. Could you create a ticket for it?
aslamshah-hivemq
left a comment
There was a problem hiding this comment.
please check the comments
…ndling for light / darkmode switch for native html elements
…iations encountered in ccv2
aslamshah-hivemq
left a comment
There was a problem hiding this comment.
The contrast fix and the field background changes look good. CI passes, and dark mode checks out in the playground, including native date pickers. Approving.
Minor, non-blocking:
- Dark
secondary.solid(gray.700) now matchessecondary.muted, so a hovered subtle secondary button looks like the solid one, and solid sits belowemphasized(gray.600). Worth a look in a follow-up. - Could drop the name from the
//RobinAtherton - …comment inconfig.ts, since git blame covers that.
Why
Follow-up to hivemq/ui-library#42 and the CCv2 dark-mode work in INT-744. With
bg.panelat gray.900 in dark mode (#54), every gray-scale tint that starts at gray.900 is invisible on a card or the sidebar:secondary.subtleis gray.900 in dark mode, the same asbg.panel. Table row hovers, selected menu items and filter chips that use it disappear.gray.subtle/gray.muted/gray.emphasizedhave the same ramp (gray.900 / 800 / 700), socolorPalette="gray"and Chakra's table row hover (colorPalette.subtle) hit the same problem.{ base: 'secondary.muted', _dark: 'secondary.emphasized' }object for the selected sidebar item, and the divider neededsecondary.emphasizedto show up at all.shell.*deprecation note still says "guidance will be added later", so consumers removing them have nothing to follow.What
secondary.subtle/muted/emphasizedfrom gray.900 / 800 / 700 to gray.800 / 700 / 600, one step offbg.panel.solidandfocusRingare unchanged. Light values are unchanged.gray.subtle/muted/emphasizedwith the same ramp. Othergray.*keys stay Chakra's.shell.*placeholder with the replacement tokens (bg,bg.panel,bg.muted,secondary.muted,secondary.emphasized,content.tertiary,content.primary). Values are kept, nothing breaks.secondary.*/gray.*tint equalsbg.panelorbgin dark mode. It fails onmain.Visible changes: dark mode only. Anything using
secondary.subtle/muted/emphasizedorgray.subtle/muted/emphasizedgets one step lighter. Light mode is pixel-identical.Once released, ui-library can drop the per-mode
activeBgobject and usesecondary.muteddirectly.Test plan
pnpm lint:allpassestheme:pnpm test:unit61 passed (6 new),pnpm buildpassestesting:pnpm test:unit116 passedmain(2 of 6:secondary.subtle,gray.subtle)