mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 03:38:52 +03:00
Accessibility: Watch & Star on small screens
The elements were hidden on small screens to preserve space and the icons still conveyed the meaning for users with intact eye vision. However, the names were no longer exposed to screen readers, and their users usually cannot obtain the meaning from the icons. Adding aria-labels to the affected templates results in certain complexity due to the DOM, so instead I decided to use some accessible CSS tricks to move the content off the screen instead of hiding it. It should remain accessible for most screen readers.
This commit is contained in:
parent
4d2c019b5a
commit
88f68850b5
1 changed files with 10 additions and 4 deletions
|
@ -89,11 +89,17 @@
|
|||
.repo-header .flex-item {
|
||||
flex-grow: 1;
|
||||
}
|
||||
.repo-buttons .ui.labeled.button .text {
|
||||
display: none;
|
||||
}
|
||||
.repo-buttons .ui.labeled.button .text,
|
||||
.repo-header .flex-item-trailing .label {
|
||||
display: none;
|
||||
/* the elements are hidden from users with intact eye vision,
|
||||
* because SVG icons convey the meaning.
|
||||
* However, they should remain accessible to screen readers */
|
||||
position: absolute;
|
||||
left: -1000vw;
|
||||
top: auto;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.repo-header .flex-item-trailing .repo-icon {
|
||||
display: initial;
|
||||
|
|
Loading…
Reference in a new issue