Skip to content

Commit

Permalink
update link styles for links in story list item for accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
poojagunturu96 committed Aug 19, 2024
1 parent 52143cf commit 14a6fc9
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 40 deletions.
6 changes: 6 additions & 0 deletions src/scss/components/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ $list-item-margin-bottom-sm: $spacing-3;
&:not(:last-child) {
margin-bottom: $list-item-margin-bottom;
}

p:last-child {
a {
@include link-border;
}
}
}

.list--dividers {
Expand Down
86 changes: 46 additions & 40 deletions src/templates/partials/story.twig
Original file line number Diff line number Diff line change
@@ -1,44 +1,50 @@
<article class="clearfix" aria-labelledby="midd-story-label-{{id}}">
{% if featured %}
<div class="mb-3">
<a href="">
<figure class="media">
{% include 'partials/img.twig' with { name: 'featured' } %}
</figure>
</a>
</div>
{% else %}
<div class="float-right ml-4 mb-4">
<a href="">
<figure class="media">
{% include 'partials/img.twig' with { name: 'story_teaser' } %}
</figure>
</a>
</div>
{% endif %}
{% if featured %}
<div class="mb-3">
<a href="">
<figure class="media">
{% include 'partials/img.twig' with { name: 'featured' } %}
</figure>
</a>
</div>
{% else %}
<div class="float-right ml-4 mb-4">
<a href="">
<figure class="media">
{% include 'partials/img.twig' with { name: 'story_teaser' } %}
</figure>
</a>
</div>
{% endif %}

<p class="d-flex flex-wrap f2 text-caps mb-1">
<a href="">Category 1</a>,&nbsp;
<a href="">Category 1</a>
</p>
<p class="d-flex flex-wrap f2 text-caps mb-1">
<a href="">Category 1</a>,&nbsp;
<a href="">Category 1</a>
</p>

<h2 class="{{featured ? 'h2' : 'h3'}} mb-1" id="midd-story-label-{{id}}">
<a href="#">
{% if env.test or random(1) %}
Longer headline starting here lorem ipsum dolor sit amet consectetur adipisicing elit
{% else %}
Shorter headline a few words
{% endif %}
</a>
</h2>
<p class="f2 mb-3">
<time datetime="">Ocotober 10, 2018</time> <span class="mx-2">|</span> by
{% for name in ['Sarah Ray', 'Stephen Diehl'] %}
<a href="" class="link-underline">{{name}}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</p>
<p class="f3">Lorem ipsum dolor sit amet consectetur adipisicing elit. Laborum rem dolor <a href="#" class="link-underline">harum consequuntur</a> laudantium commodi accusantium debitis quisquam eligendi deleniti itaque saepe voluptatibus soluta necessitatibus, voluptas minus possimus? Itaque, sed.</p>
{% if env.test or random(1) %}
<span class="badge mt-2">Video</span>
{% endif %}
<h2 class="{{featured ? 'h2' : 'h3'}} mb-1" id="midd-story-label-{{id}}">
<a href="#">
{% if env.test or random(1) %}
Longer headline starting here lorem ipsum dolor sit amet consectetur adipisicing elit
{% else %}
Shorter headline a few words
{% endif %}
</a>
</h2>
<p class="f2 mb-3">
<time datetime="">Ocotober 10, 2018</time>
<span class="mx-2">|</span>
by
{% for name in ['Sarah Ray', 'Stephen Diehl'] %}
<a href="">{{name}}</a>
{% if not loop.last %},
{% endif %}
{% endfor %}
</p>
<p class="f3">Lorem ipsum dolor sit amet consectetur adipisicing elit. Laborum rem dolor
<a href="#" class="link-underline">harum consequuntur</a>
laudantium commodi accusantium debitis quisquam eligendi deleniti itaque saepe voluptatibus soluta necessitatibus, voluptas minus possimus? Itaque, sed.</p>
{% if env.test or random(1) %}
<span class="badge mt-2">Video</span>
{% endif %}
</article>

0 comments on commit 14a6fc9

Please sign in to comment.