Skip to content

Commit b20634b

Browse files
committed
Fix review findings: clip-path, aria-labelledby fallbacks, alt escaping
- Replace deprecated clip: rect() with clip-path: inset(50%) in .visually-hidden - Add fallback h2 headings for aria-labelledby references when titles are absent - Use double-stash escaping for alt attribute values to prevent injection
1 parent 9ed11d4 commit b20634b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/css/home.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ main.article.labs footer.footer .footer__social-link:hover {
802802
padding: 0;
803803
margin: -1px;
804804
overflow: hidden;
805-
clip: rect(0, 0, 0, 0);
805+
clip-path: inset(50%);
806806
white-space: nowrap;
807807
border: 0;
808808
}

src/partials/component-home-v2.hbs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
<p class="home-ai-summary">{{{page.attributes.home-ai-summary}}}</p>
1414
{{/if}}
1515
{{#if page.attributes.home-image}}
16-
<img style="max-height: 150px;min-height: 120px;" src="../_images/{{page.attributes.home-image}}" alt="{{#if page.attributes.home-image-alt}}{{{page.attributes.home-image-alt}}}{{else}}{{{page.title}}}{{/if}}" loading="lazy"/>
16+
<img style="max-height: 150px;min-height: 120px;" src="../_images/{{page.attributes.home-image}}" alt="{{#if page.attributes.home-image-alt}}{{page.attributes.home-image-alt}}{{else}}{{page.title}}{{/if}}" loading="lazy"/>
1717
{{/if}}
1818
</div>
1919
</div>
2020
</section>
2121
<section class="sect1 features" aria-labelledby="home-primary-title">
2222
{{#with page.attributes.home-primary-row-title}}
2323
<h2 id="home-primary-title">{{{this}}}<a class="anchor" href="#home-primary-title"></a></h2>
24+
{{else}}
25+
<h2 id="home-primary-title" class="visually-hidden">Featured content</h2>
2426
{{/with}}
2527
<div class="sectionbody container">
2628
<div class="grid-primary boxes">
@@ -45,6 +47,8 @@
4547
<section class="sect1 features" aria-labelledby="home-secondary-title">
4648
{{#with page.attributes.home-secondary-row-title}}
4749
<h2 id="home-secondary-title">{{{this}}}<a class="anchor" href="#home-secondary-title"></a></h2>
50+
{{else}}
51+
<h2 id="home-secondary-title" class="visually-hidden">More resources</h2>
4852
{{/with}}
4953
<div class="sectionbody container">
5054
<div class="grid-secondary boxes">
@@ -69,6 +73,8 @@
6973
<section class="sect1 features" aria-labelledby="home-tertiary-title">
7074
{{#with page.attributes.home-tertiary-row-title}}
7175
<h2 id="home-tertiary-title">{{{this}}}<a class="anchor" href="#home-tertiary-title"></a></h2>
76+
{{else}}
77+
<h2 id="home-tertiary-title" class="visually-hidden">Additional links</h2>
7278
{{/with}}
7379
<div class="sectionbody container">
7480
<nav aria-label="Additional resources">

0 commit comments

Comments
 (0)