-
Notifications
You must be signed in to change notification settings - Fork 41
Refine admin dropdown menus #3251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ff67a04
7cb7407
173c07e
4f0d8fb
0c4aca0
2bfa77c
32877c4
c4f53cd
fac15c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -100,9 +100,6 @@ h1 .fa-caret-down { | |||||||||||||||||||||||||||||
| min-width: 200px !important; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .preview .frm-dropdown-menu { | ||||||||||||||||||||||||||||||
| min-width: 230px !important; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .frm-dropdown-menu.dropdown-menu-right { | ||||||||||||||||||||||||||||||
| right: 0; | ||||||||||||||||||||||||||||||
|
|
@@ -250,3 +247,108 @@ a.frm_option_icon:hover::before { | |||||||||||||||||||||||||||||
| padding: 4px; | ||||||||||||||||||||||||||||||
| margin-bottom: 3px; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||
| * Action menus: the Preview dropdown and the style options menu. | ||||||||||||||||||||||||||||||
| * These hover neutral so blue stays reserved for the selected state. | ||||||||||||||||||||||||||||||
| * Pickers and multiselect lists keep the blue hover from _code-list.scss. | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| .frm-dropdown-menu.frm-style-options-menu, | ||||||||||||||||||||||||||||||
| .preview.dropdown .frm-dropdown-menu { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||
| * Strictly concentric with the 6px items plus 6px padding would be 12px. 10px | ||||||||||||||||||||||||||||||
| * is used because it reads better at this size, and 2px is not a difference | ||||||||||||||||||||||||||||||
| * the eye can find when the items sit 6px in from the corner. | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| border-radius: 10px; | ||||||||||||||||||||||||||||||
| padding: 6px; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||
| * width: auto would size this against the space available beside it, which | ||||||||||||||||||||||||||||||
| * clamps the panel near a container edge and lets overflow-x: hidden crop | ||||||||||||||||||||||||||||||
| * the longest label. max-content sizes against the rows instead. | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| width: max-content; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| > .dropdown-item + .dropdown-item { | ||||||||||||||||||||||||||||||
| margin-top: 2px; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||
| * The shared rule in _code-list.scss carries :link and :visited to override | ||||||||||||||||||||||||||||||
| * jQuery UI, which lifts its specificity to match this block. That file is | ||||||||||||||||||||||||||||||
| * imported later, so those pseudo-classes are repeated here to win the tie. | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| > .dropdown-item > a, | ||||||||||||||||||||||||||||||
| > .dropdown-item > a:link, | ||||||||||||||||||||||||||||||
| > .dropdown-item > a:visited { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||
| * 8px horizontal matches the optical gap above and below the label. | ||||||||||||||||||||||||||||||
| * The 24px line-height on 16px text leaves ~4.4px of half-leading, so | ||||||||||||||||||||||||||||||
| * equal padding values would not read as equal space. | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| padding: 4px 8px; | ||||||||||||||||||||||||||||||
|
Comment on lines
+287
to
+292
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Enforce the specified 36px row height. With the stated 24px line-height and 4px vertical padding, each row is approximately 32px. Set a 36px minimum height or adjust the vertical padding. Suggested change padding: 4px 8px;
+ min-height: 36px;
+ box-sizing: border-box;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| border-radius: 6px; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* Icons ink to the full box, so they sit closer to the label than a padded set would. */ | ||||||||||||||||||||||||||||||
| gap: 10px; | ||||||||||||||||||||||||||||||
| transition: | ||||||||||||||||||||||||||||||
| 0.12s background-color ease, | ||||||||||||||||||||||||||||||
| 0.12s color ease; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @include focus-outline($radius: 6px); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .frmsvg { | ||||||||||||||||||||||||||||||
| width: 16px; | ||||||||||||||||||||||||||||||
| height: 16px; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* Without this the icon is what collapses when the row runs out of room. */ | ||||||||||||||||||||||||||||||
| flex-shrink: 0; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* Replaces an opacity fade. --grey-500 is described as roughly 65% opacity. */ | ||||||||||||||||||||||||||||||
| opacity: 1; | ||||||||||||||||||||||||||||||
| color: var(--grey-500); | ||||||||||||||||||||||||||||||
| transition: 0.12s color ease; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| &:hover { | ||||||||||||||||||||||||||||||
| background: var(--grey-100); | ||||||||||||||||||||||||||||||
| color: var(--grey-900); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .frmsvg { | ||||||||||||||||||||||||||||||
| color: var(--grey-900); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .preview.dropdown .frm-dropdown-toggle { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .frmsvg { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /* Replaces the inherited transition: all. */ | ||||||||||||||||||||||||||||||
| transition: transform 200ms ease-out; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| &[aria-expanded="true"] .frmsvg { | ||||||||||||||||||||||||||||||
| transform: rotate(-180deg); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @media (prefers-reduced-motion: reduce) { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .frm-dropdown-menu.frm-style-options-menu, | ||||||||||||||||||||||||||||||
| .preview.dropdown .frm-dropdown-menu { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| > .dropdown-item > a, | ||||||||||||||||||||||||||||||
| > .dropdown-item > a .frmsvg { | ||||||||||||||||||||||||||||||
| transition: none; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .preview.dropdown .frm-dropdown-toggle .frmsvg { | ||||||||||||||||||||||||||||||
| transition: none; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Constrain content-based menus to the available viewport.
width: max-contentcan make a menu wider than its containing block. The inheritedwhite-space: nowrapat Line 127 andoverflow-x: hiddenat Line 68 can leave long labels inaccessible. Add a viewport constraint and allow labels to wrap or truncate.🤖 Prompt for AI Agents