mirror of
https://github.com/vinta/awesome-python.git
synced 2026-03-23 13:56:43 +08:00
fix(website): accessibility and defensive layout improvements
- Add aria-sort attributes to table header on sort state changes - Replace .table-wrap:focus outline:none with focus-visible outline - Move noscript message above the fold into main, before content - Upgrade hero-topbar div to nav with aria-label for landmark semantics - Remove role=button from tr elements (invalid ARIA on native elements) - Fix back-to-top button label and text (was labelled 'Back to search') - Switch font-size from 16px to 100% to respect user browser preferences - Add overflow-wrap and word-break to .col-name and description cells Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -212,6 +212,9 @@ function updateSortIndicators() {
|
||||
th.classList.remove('sort-asc', 'sort-desc');
|
||||
if (activeSort && th.dataset.sort === activeSort.col) {
|
||||
th.classList.add('sort-' + activeSort.order);
|
||||
th.setAttribute('aria-sort', activeSort.order === 'asc' ? 'ascending' : 'descending');
|
||||
} else {
|
||||
th.removeAttribute('aria-sort');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 16px;
|
||||
font-size: 100%;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
@@ -523,8 +523,9 @@ kbd {
|
||||
scroll-margin-top: 1rem;
|
||||
}
|
||||
|
||||
.table-wrap:focus {
|
||||
outline: none;
|
||||
.table-wrap:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.table {
|
||||
@@ -617,6 +618,8 @@ kbd {
|
||||
color: var(--ink);
|
||||
font-size: clamp(1rem, 1.5vw, 1.08rem);
|
||||
font-weight: 700;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.col-name > a:hover {
|
||||
@@ -734,6 +737,8 @@ th[data-sort].sort-asc::after {
|
||||
color: var(--ink-soft);
|
||||
line-height: 1.7;
|
||||
text-wrap: pretty;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
animation: expand-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user