Skip to content

Commit fad879f

Browse files
Copilotpethers
andcommitted
Add skip-to-content CSS, skip links to news articles and template, update tests
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
1 parent 8cc08c8 commit fad879f

941 files changed

Lines changed: 2813 additions & 1833 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cypress/e2e/accessibility.cy.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,14 @@ describe('Accessibility (WCAG 2.1 AA)', () => {
107107
});
108108

109109
it('should have skip to content link', () => {
110-
cy.get('a[href="#main-content"], a[href="#main"]').should('exist');
110+
cy.get('a[href="#main-content"], a[href="#main"], a[href="#main-dashboard"]').should('exist');
111+
});
112+
113+
it('should have skip link as first focusable element', () => {
114+
cy.get('a[href="#main-content"], a[href="#main"], a[href="#main-dashboard"]').first().then(($el) => {
115+
const classList = Array.from($el[0].classList);
116+
expect(classList.some(c => c.includes('skip'))).to.be.true;
117+
});
111118
});
112119

113120
it('should support reduced motion preference', () => {

news/2026-02-10-biodiversity-citizenship-en.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292

9393
</head>
9494
<body>
95-
<nav class="language-switcher" role="navigation" aria-label="Language">
95+
<a href="#main-content" class="skip-link">Skip to main content</a>
96+
<nav class="language-switcher" role="navigation" aria-label="Language">
9697
<a href="2026-02-10-biodiversity-citizenship-en.html" class="lang-link active" hreflang="en" aria-current="page">🇬🇧 English</a>
9798
<a href="2026-02-10-biodiversity-citizenship-sv.html" class="lang-link" hreflang="sv">🇸🇪 Svenska</a>
9899
<a href="2026-02-10-biodiversity-citizenship-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -114,7 +115,7 @@
114115
</a>
115116
</div>
116117

117-
<article class="news-article">
118+
<article id="main-content" class="news-article">
118119
<header class="article-header">
119120
<h1>Government Announces Dual Policy Push: Biodiversity Strategy and Stricter Citizenship Rules</h1>
120121
<div class="article-meta">

news/2026-02-10-biodiversity-citizenship-sv.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292

9393
</head>
9494
<body>
95-
<nav class="language-switcher" role="navigation" aria-label="Språk">
95+
<a href="#main-content" class="skip-link">Hoppa till huvudinnehåll</a>
96+
<nav class="language-switcher" role="navigation" aria-label="Språk">
9697
<a href="2026-02-10-biodiversity-citizenship-en.html" class="lang-link" hreflang="en">🇬🇧 English</a>
9798
<a href="2026-02-10-biodiversity-citizenship-sv.html" class="lang-link active" hreflang="sv" aria-current="page">🇸🇪 Svenska</a>
9899
<a href="2026-02-10-biodiversity-citizenship-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -114,7 +115,7 @@
114115
</a>
115116
</div>
116117

117-
<article class="news-article">
118+
<article id="main-content" class="news-article">
118119
<header class="article-header">
119120
<h1>Regeringen presenterar dubbel policysatsning: Biologisk mångfald och strängare medborgarskapsregler</h1>
120121
<div class="article-meta">

news/2026-02-10-pm-eu-summit-en.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696

9797
</head>
9898
<body>
99-
<nav class="language-switcher" role="navigation" aria-label="Language">
99+
<a href="#main-content" class="skip-link">Skip to main content</a>
100+
<nav class="language-switcher" role="navigation" aria-label="Language">
100101
<a href="2026-02-10-pm-eu-summit-en.html" class="lang-link active" hreflang="en" aria-current="page">🇬🇧 English</a>
101102
<a href="2026-02-10-pm-eu-summit-sv.html" class="lang-link" hreflang="sv">🇸🇪 Svenska</a>
102103
<a href="2026-02-10-pm-eu-summit-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -118,7 +119,7 @@
118119
</a>
119120
</div>
120121

121-
<article class="news-article">
122+
<article id="main-content" class="news-article">
122123
<header class="article-header">
123124
<h1>Prime Minister Faces Parliament Before Brussels Summit</h1>
124125
<div class="article-meta">

news/2026-02-10-pm-eu-summit-sv.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080

8181
</head>
8282
<body>
83-
<nav class="language-switcher" role="navigation" aria-label="Språk">
83+
<a href="#main-content" class="skip-link">Hoppa till huvudinnehåll</a>
84+
<nav class="language-switcher" role="navigation" aria-label="Språk">
8485
<a href="2026-02-10-pm-eu-summit-en.html" class="lang-link" hreflang="en">🇬🇧 English</a>
8586
<a href="2026-02-10-pm-eu-summit-sv.html" class="lang-link active" hreflang="sv" aria-current="page">🇸🇪 Svenska</a>
8687
<a href="2026-02-10-pm-eu-summit-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -102,7 +103,7 @@
102103
</a>
103104
</div>
104105

105-
<article class="news-article">
106+
<article id="main-content" class="news-article">
106107
<header class="article-header">
107108
<h1>Statsministern möter riksdagen inför Brysseltoppmöte</h1>
108109
<div class="article-meta">

news/2026-02-10-week-ahead-feb-10-17-en.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494

9595
</head>
9696
<body>
97-
<nav class="language-switcher" role="navigation" aria-label="Language">
97+
<a href="#main-content" class="skip-link">Skip to main content</a>
98+
<nav class="language-switcher" role="navigation" aria-label="Language">
9899
<a href="2026-02-10-week-ahead-feb-10-17-en.html" class="lang-link active" hreflang="en" aria-current="page">🇬🇧 English</a>
99100
<a href="2026-02-10-week-ahead-feb-10-17-sv.html" class="lang-link" hreflang="sv">🇸🇪 Svenska</a>
100101
<a href="2026-02-10-week-ahead-feb-10-17-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -116,7 +117,7 @@
116117
</a>
117118
</div>
118119

119-
<article class="news-article">
120+
<article id="main-content" class="news-article">
120121
<header class="article-header">
121122
<h1>Week Ahead: Brussels Summit Tests Swedish EU Strategy</h1>
122123
<div class="article-meta">

news/2026-02-10-week-ahead-feb-10-17-sv.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494

9595
</head>
9696
<body>
97-
<nav class="language-switcher" role="navigation" aria-label="Språk">
97+
<a href="#main-content" class="skip-link">Hoppa till huvudinnehåll</a>
98+
<nav class="language-switcher" role="navigation" aria-label="Språk">
9899
<a href="2026-02-10-week-ahead-feb-10-17-en.html" class="lang-link" hreflang="en">🇬🇧 English</a>
99100
<a href="2026-02-10-week-ahead-feb-10-17-sv.html" class="lang-link active" hreflang="sv" aria-current="page">🇸🇪 Svenska</a>
100101
<a href="2026-02-10-week-ahead-feb-10-17-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -116,7 +117,7 @@
116117
</a>
117118
</div>
118119

119-
<article class="news-article">
120+
<article id="main-content" class="news-article">
120121
<header class="article-header">
121122
<h1>Veckan som kommer: Brysseltoppmöte testar svensk EU-strategi</h1>
122123
<div class="article-meta">

news/2026-02-13-evening-analysis-ar.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@
223223

224224
</head>
225225
<body>
226-
<nav class="language-switcher" role="navigation" aria-label="اللغة">
226+
<a href="#main-content" class="skip-link">الانتقال إلى المحتوى الرئيسي</a>
227+
<nav class="language-switcher" role="navigation" aria-label="اللغة">
227228
<a href="2026-02-13-evening-analysis-en.html" class="lang-link" hreflang="en">🇬🇧 English</a>
228229
<a href="2026-02-13-evening-analysis-sv.html" class="lang-link" hreflang="sv">🇸🇪 Svenska</a>
229230
<a href="2026-02-13-evening-analysis-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -245,7 +246,7 @@
245246
</a>
246247
</div>
247248

248-
<article class="news-article">
249+
<article id="main-content" class="news-article">
249250
<header class="article-header">
250251
<h1>البرلمان السويدي في عطلة الربيع: تقييم نصف الدورة للسجل التشريعي لحكومة تيدو</h1>
251252
<div class="article-meta">

news/2026-02-13-evening-analysis-da.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@
223223

224224
</head>
225225
<body>
226-
<nav class="language-switcher" role="navigation" aria-label="Sprog">
226+
<a href="#main-content" class="skip-link">Gå til hovedindhold</a>
227+
<nav class="language-switcher" role="navigation" aria-label="Sprog">
227228
<a href="2026-02-13-evening-analysis-en.html" class="lang-link" hreflang="en">🇬🇧 English</a>
228229
<a href="2026-02-13-evening-analysis-sv.html" class="lang-link" hreflang="sv">🇸🇪 Svenska</a>
229230
<a href="2026-02-13-evening-analysis-da.html" class="lang-link active" hreflang="da" aria-current="page">🇩🇰 Dansk</a>
@@ -245,7 +246,7 @@
245246
</a>
246247
</div>
247248

248-
<article class="news-article">
249+
<article id="main-content" class="news-article">
249250
<header class="article-header">
250251
<h1>Sveriges Riksdag i forårspause: En midtvejsvurdering af Tidö-regeringens lovgivningspræstation</h1>
251252
<div class="article-meta">

news/2026-02-13-evening-analysis-de.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@
223223

224224
</head>
225225
<body>
226-
<nav class="language-switcher" role="navigation" aria-label="Sprache">
226+
<a href="#main-content" class="skip-link">Zum Hauptinhalt springen</a>
227+
<nav class="language-switcher" role="navigation" aria-label="Sprache">
227228
<a href="2026-02-13-evening-analysis-en.html" class="lang-link" hreflang="en">🇬🇧 English</a>
228229
<a href="2026-02-13-evening-analysis-sv.html" class="lang-link" hreflang="sv">🇸🇪 Svenska</a>
229230
<a href="2026-02-13-evening-analysis-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a>
@@ -245,7 +246,7 @@
245246
</a>
246247
</div>
247248

248-
<article class="news-article">
249+
<article id="main-content" class="news-article">
249250
<header class="article-header">
250251
<h1>Schwedens Riksdag in der Frühjahrspaüse: Eine Halbzeitbewertung der Gesetzgebungsbilanz der Tidö-Regierung</h1>
251252
<div class="article-meta">

0 commit comments

Comments
 (0)