Accessibility: Add skip link & landmark regions to settings (#39129)

This commit is contained in:
diondiondion
2026-05-21 15:41:14 +02:00
committed by GitHub
parent 6735902c1a
commit e54f927149
3 changed files with 31 additions and 2 deletions

View File

@@ -136,6 +136,11 @@ $content-width: 840px;
transition: all 100ms linear; transition: all 100ms linear;
transition-property: color, background-color; transition-property: color, background-color;
} }
&:focus-visible {
outline: var(--outline-focus-default);
outline-offset: -2px;
}
} }
ul { ul {
@@ -1887,6 +1892,28 @@ a.sparkline {
} }
} }
.navigation-skip-link {
position: fixed;
z-index: 100;
margin: 10px;
padding: 10px 16px;
border-radius: 10px;
font-size: 15px;
color: var(--color-text-primary);
background: var(--color-bg-primary);
box-shadow: var(--dropdown-shadow);
/* Hide visually when not focused */
&:not(:focus-within) {
width: 1px;
height: 1px;
margin: 0;
padding: 0;
clip-path: inset(50%);
overflow: hidden;
}
}
.section-skip-link { .section-skip-link {
float: right; float: right;

View File

@@ -6,8 +6,9 @@
- content_for :body_classes, 'admin' - content_for :body_classes, 'admin'
- content_for :content do - content_for :content do
%a.navigation-skip-link{ href: '#content' }= t('admin.skip_to_content')
.admin-wrapper .admin-wrapper
.sidebar-wrapper %nav.sidebar-wrapper
.sidebar-wrapper__inner .sidebar-wrapper__inner
.sidebar .sidebar
= link_to root_path do = link_to root_path do
@@ -24,7 +25,7 @@
= render_navigation = render_navigation
.content-wrapper %main.content-wrapper#content
.content .content
.content__heading .content__heading
- if content_for?(:heading) - if content_for?(:heading)

View File

@@ -979,6 +979,7 @@ en:
site_uploads: site_uploads:
delete: Delete uploaded file delete: Delete uploaded file
destroyed_msg: Site upload successfully deleted! destroyed_msg: Site upload successfully deleted!
skip_to_content: Skip to content
software_updates: software_updates:
critical_update: Critical — please update quickly critical_update: Critical — please update quickly
description: It is recommended to keep your Mastodon installation up to date to benefit from the latest fixes and features. Moreover, it is sometimes critical to update Mastodon in a timely manner to avoid security issues. For these reasons, Mastodon checks for updates every 30 minutes, and will notify you according to your email notification preferences. description: It is recommended to keep your Mastodon installation up to date to benefit from the latest fixes and features. Moreover, it is sometimes critical to update Mastodon in a timely manner to avoid security issues. For these reasons, Mastodon checks for updates every 30 minutes, and will notify you according to your email notification preferences.