Use first two letters of menu item as default icon
3 unresolved threads
3 unresolved threads
Refactor icon approach to inline SVGs instead of via CSS. This allows us to consolidate logic for both the icons and the default first two letters display, without having to do a lot of wonky CSS overrides. It also prevents the CSS from bloating each time a new icon is supported, and eliminates network requests.
Add aria-hidden to SVGs for accessibility. Hide these graphics from screen readers, as they are purely decorative.
Closes #3424744
Merge request reports
Activity
added 5 commits
-
54604aaf...f27440c0 - 2 commits from branch
project:1.x
- 72f06374 - Add aria-hidden to SVGs for accessibility
- a77f20dd - Use first two letters of menu item as default icon
- e88b52fd - Fix abbreviation layout shift on menu collapse
Toggle commit list-
54604aaf...f27440c0 - 2 commits from branch
added 8 commits
-
e88b52fd...f7224ff8 - 3 commits from branch
project:1.x
- 8524152b - Add aria-hidden to SVGs for accessibility
- 0cc1487d - Use first two letters of menu item as default icon
- 94bfb3ae - Fix abbreviation layout shift on menu collapse
- 36efd79b - Revert SVG aria-hidden addition
- a079e1f0 - Revert to CSS icons instead of inline SVGs
Toggle commit list-
e88b52fd...f7224ff8 - 3 commits from branch
143 137 } 144 138 } 145 139 140 .toolbar-button__abbreviation { 141 display: flex; 142 align-items: center; 143 /* Set the font smaller so it fits when the menu is collapsed. */ 144 font-size: calc(0.75 * var(--admin-toolbar-rem)); 145 /* Reset the height to the same as the surrounding text, 146 to prevent layout shift on menu collapse. 1.2 is to match the line height. */ 147 block-size: calc(1.2 * var(--admin-toolbar-rem)); 148 } 149 150 /* Hide the default two letter abbreviation for items with icons. */ 151 .toolbar-button--icon--burger, 155 148 order: -1; 156 149 } 157 150 151 .toolbar-button__abbreviation { probably also can be resolved with just simple attribute https://developer.mozilla.org/en-US/docs/Web/CSS/attr#content_property
Please register or sign in to reply