Repository navigation
feat(components): size menu labels and tags from the control text - #7344
benjamincanac wants to merge 8 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Client output of the apps in
Raw sizes
|
Merging this PR will not alter performance
Comparing Footnotes
|
commit: |
# Conflicts: # test/components/__snapshots__/CommandPalette-vue.spec.ts.snap # test/components/__snapshots__/CommandPalette.spec.ts.snap
🔗 Linked issue
Part of #6918, Epic B of #6610
❓ Type of change
📚 Description
The group labels of the menus disagreed: DropdownMenu and ContextMenu drew them at item size on the control scale, while Select, SelectMenu, InputMenu, CommandPalette, Listbox and EditorSuggestionMenu drew them smaller with literal classes that ignored a
--ui-control-text-*override.Those literals followed a rule nobody wrote down: the item text minus 2px, its line height minus 4px. This PR writes that rule against the item's tokens on all eight,
text-[calc(var(--ui-control-text-<size>)-0.125rem)]/[calc(var(--ui-control-text-<size>--line-height)-0.25rem)], so a label follows the scale and stays smaller than its items at every size. Reading the token of the size below doesn't work, since the scale repeats its text atxs/smandmd/lg, which would leave the label the size of its items atsmandlg.Measured in the playground, the six literal menus render the same as before. DropdownMenu and ContextMenu labels get 2px smaller at every size:
xssmmdlgxlThe tags of InputTags and InputMenu had the same literals, so they get the same rule, and their delete icon,
size-3tosize-4, now reads--ui-control-text-<size>, which gives the same 12px to 16px. Both render the same as before. DashboardSearch and ContentSearch follow CommandPalette. The migration guide gets a line in Control sizes.A label now reads as a group heading, so the DropdownMenu and ContextMenu examples that used one as an account row with an avatar, alone in its group, now put it at the top of the next group without the avatar, the dashboard template guide included. The checkbox examples drop the separator between the label and its items, and the icon on the label.
📝 Checklist