-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Added show icon labels option #15830
Changes from all commits
d8b4250
7aa7f88
8370fa3
daaec4f
64c452a
41a6456
2685980
3508c61
4d127fd
2a96c72
585b81a
2ef2d38
c66a1ea
ce28dbc
477fad7
941a0bb
229addc
fee19fd
8478475
2fcd682
fac54fa
90595aa
bccbab5
ea00342
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,34 @@ | |
display: flex; | ||
} | ||
} | ||
&.show-icon-labels { | ||
button[aria-label] { | ||
display: inline-flex; | ||
flex-wrap: nowrap; | ||
&::after { | ||
content: attr(aria-label); | ||
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. This is an interesting approach. I like it keeps the components relatively clean. 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. I'd like to get some A11y feedback on this, as support for 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. Indeed. 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. I found that @afercia already had an opinion on this: #10524 (comment) 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. @swissspidy thanks Pascal for raising this concern. You're right that some screen readers read out CSS generated content but in this case the whole content of the buttons is overridden by the aria-label so that only the aria-label is announced. To be 100% sure, I tested it also with NVDA and JAWS on Windows Firefox / Chrome. 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. Wouldn't it be easier to inline this label inside HTML when |
||
display: block; | ||
font-size: 12px; | ||
margin-left: 5px; | ||
} | ||
&.is-primary { | ||
&::after { | ||
padding-right: 8px; | ||
} | ||
} | ||
} | ||
[aria-orientation=vertical] & { | ||
display: block; | ||
} | ||
> div, > button { | ||
[aria-orientation=vertical] & { | ||
display: block; | ||
button { | ||
width: 100%; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Block toolbar when fixed to the top of the screen. | ||
|
@@ -75,7 +103,7 @@ | |
|
||
.block-editor-block-toolbar .components-toolbar-group, | ||
.block-editor-block-toolbar .components-toolbar { | ||
$top-toolbar-padding: ($header-height - $grid-unit-60) / 2; | ||
$top-toolbar-padding: ( $header-height - $grid-unit-60 ) / 2; | ||
height: $header-height; | ||
padding: $top-toolbar-padding 0; | ||
} | ||
|
@@ -86,7 +114,6 @@ | |
margin-right: $grid-unit-10; | ||
// Special dimensions for this button. | ||
min-width: 32px; | ||
width: 32px; | ||
height: 32px; | ||
padding: 0; | ||
} |
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.
this was removed based on this comment: #19058 (comment)
cc @tellthemachines