Skip to content
Snippets Groups Projects

Use first two letters of menu item as default icon

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

Code Quality is loading
Test summary results are being parsed

Closed by m4oliveim4olivei 1 year ago (May 1, 2024 7:30pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
35 35 line-height: 1.2;
36 36 gap: calc(0.625 * var(--admin-toolbar-rem));
37 37
38 &::before {
  • Chris DeLuca added 1 commit

    added 1 commit

    • 549dbaf4 - Forgot to commit the compiled CSS

    Compare with previous version

  • 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 {
  • closed

  • Please register or sign in to reply
    Loading