The underline on the current navigation link should be a choice, not a fixture #289
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#289
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported as: the highlight on the navigation is unwelcome. This is what put it there, and what to do about it.
Where it came from, in two parts
The current link has had a background tint since the first interface commit —
181c5728e(M1),.nav-link-active { @apply nav-link bg-ink-100 text-ink-900 dark:bg-ink-800 dark:text-ink-50; }. That is the original design and nobody has objected to it.What is new is the weight and the underline, added three days ago by
f6fbc6e08(#274), witharia-current="page"beside it:It was added deliberately, for accessibility, and the reason is in the rule's own comment (
assets/css/app.css:489) and in that commit's message:That is WCAG 2.2 SC 1.4.1, Use of Colour: a 1.1:1 tint is the only thing saying which page you are on, which is nothing to somebody who does not distinguish those two greys — and nothing at all under Windows High Contrast, where the background is thrown away and a text decoration is kept.
a94ec5c2b(#277) then gave it aButtonTextborder in the forced-colours block for the same reason.So it was intentional, and by the standing rule — if it was added for accessibility, make it optional rather than removing it — this is a preference, not a revert.
What to build
A switch under Settings → Accessibility, which exists since #281 and is exactly where this belongs, beside the career order number and the keyboard shortcuts.
The switch should govern the underline alone. Removing every non-colour cue would put the person's own interface below what the project claims in the README and on the wiki's Accessibility page, and they would not have been told that is what the switch does. Keeping
font-semiboldis a visual difference that is not colour, so SC 1.4.1 holds in both states, and the quiet version is genuinely quieter:aria-current="page"It must not apply under forced colours.
@media (forced-colors: active)discards the background and most of the weight distinction, and the text decoration is the cue that survives — so the underline stays there whatever the preference. That is one extra rule, and leaving it out would be the version of this change that actually breaks something.Where it is, and what else it touches
.nav-link-activeis not only the masthead. Five templates use it, and a preference on the class reaches all of them:templates/partials/nav_links.html:12templates/partials/sidebar.html:15templates/applications/calendar.html:64templates/jobs/listing_list.html:72tests/test_career_sections.pyConsistency argues for one switch over all of them. If the complaint is only about the masthead, say so on the issue and it can be narrowed — but two kinds of current-link in one interface is worse than either.
How, with no script
The established pattern, from #227: the profile field reaches the body as a data attribute, and the stylesheet reads it.
base.html:57already carriesdata-shortcuts="off", fed bycore/context_processors.py:63. So:BooleanFieldonProfile, defaulting toTrue, with a migration;data-nav-underline="off"on<body>when it is off;body[data-nav-underline="off"] .nav-link-active { text-decoration: none; }, and the forced-colours block putting it back.No request, no script, and it is right with scripts off, which is the rule for every control here.
Points to settle
Notes for whoever takes it
tests/test_contrast.py:89assertsfont-semiboldandunderlineare both in the rule. It stays true of the default; the test should say default and gain a sibling for the off state, rather than being weakened.tests/test_navigation.py:96,104,107andtests/test_career_sections.py:66-77pin the class andaria-current; neither changes, since only the decoration moves.text-decoration-lineof the current link with the preference on and off, and under emulated forced colours, where it must beunderlineeither way.tests/e2e/test_rendering_modes.pyalready emulates that.Refs postulo/postulo#N.fr-fr,pt-pt,pt-brasdraft; the rest at the release sweep.npm run build:css, since the stylesheet gains a rule.Landed on
mainasceaad90ea.