Repository navigation
feat(theme): rest the header tool buttons in a quiet tone - #237
Merged
Merged
Conversation
Adds the control tokens --control-rest, --control-current, --control-current-fill and --control-disabled. The menu, panel, search, theme, media and repository buttons rest in the secondary tone and turn bright on hover or when the mobile menu is open; with prefers-contrast: more they keep the primary tone. Gallery buttons that cannot move further use the disabled tone.
… throughout Sets the control tokens again in the header over the beach hero, where the text turns white. Only the open overlay menu brightens the menu button; on wide screens it toggles a panel and stays quiet. The menu button hovers to --link like the other round buttons, the code copy button and gallery controls use --control-rest, and the header buttons get their color from one shared rule.
The sidebar of a tab section now always starts with the section's own page, flush with the tabs and in normal case, so readers reach it from the sidebar and not only from the tab. Before, it was a small uppercase label that was hidden whenever pages outside the tabs followed.
The bar behind the header and tabs fades its background over 300 ms for the hero, so on a theme switch it lagged behind the page and flashed grey. theme.js now turns transitions off for two frames whenever the color scheme changes, by the toggle or by the system.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts "quiet controls" (from the TenFingers UX concept, adapted for the web): tool buttons are not the content, so they rest in the secondary tone like the navigation already does, and only light up when they are the topic.
main.css:--control-rest(=--text-secondary),--control-current(=--text-primary),--control-current-fill(10 % primary over the page) and--control-disabled(30 % primary). Aliases, so dark mode and custom palettes follow on their own.--linkfor the round buttons; the square panel toggles get--hover-backgroundplus the primary tone). The open mobile menu (aria-expanded="true") shows the primary tone.prefers-contrast: morekeeps tool buttons in the primary tone.--control-disabledinstead of secondary at 60 % opacity.Contrast: rest 5.20:1 (light) / 5.64:1 (dark) on the page, above AA for text; disabled 1.97:1 / 2.51:1, clearly below the rest tone.
Checked in a served page (design system docs) in light and dark mode at 1440 px and 390 px: header tool buttons quiet, title and current tab bright, the open mobile menu bright, keyboard focus ring unchanged.
Markdown.Renderer.Testgreen (788).