Make certain components hidden from accessibility tree

This commit is contained in:
Gabriel Arazas 2023-02-24 18:39:55 +08:00
parent abfa15d65c
commit 657fb2c1a3
5 changed files with 11 additions and 6 deletions

View File

@ -20,6 +20,11 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version
== Unreleased
== Added
- Accessibility tags for certain elements in the website (i.e., `<hr>` in non-content).
== Updated
- Spacing between basic elements (i.e., `<p>`).

View File

@ -6,9 +6,9 @@
<body>
{{- partial "components/theme-button.html" . }}
{{- partial "header.html" . -}}
<hr>
<hr aria-hidden="true"/>
{{- block "main" . }}{{- end }}
<hr>
<hr aria-hidden="true"/>
{{- partial "footer.html" . -}}
</body>
</html>

View File

@ -21,8 +21,8 @@
{{ .Content }}
</main>
<hr>
<div class="post__meta--single">
<hr aria-hidden="true"/>
<div class="post__meta--single" aria-hidden="true">
<!-- List the author(s) of the article. -->
{{- with .Params.author }}
{{- $names := slice }}

View File

@ -2,7 +2,7 @@
The component where it will display the metadata of the post.
This is used on list templates but feel free to change that.
*/ -}}
<div class="list post__meta">
<div class="list post__meta" aria-hidden="true">
{{- if ne (.PublishDate.Format "2006") "0001" -}}
<time datetime="{{ .PublishDate }}" title="{{ i18n "published_on" }}">
{{ partial "components/heroicon.html" "calendar" }}

View File

@ -3,7 +3,7 @@
Take note this component already has conditional rendering so a conditional is unnecessary.
*/ -}}
{{- if gt (len (index $.Site.Data "more-contentful").themes) 1 }}
<div class="site__theme-btn" aria-label="Theme toggle">
<div class="site__theme-btn" aria-label="Theme toggle" aria-hidden="true">
{{ partial "components/heroicon.html" "swatch" }}
<div class="site__theme-dropdown">
<div class="site__theme-dropdown-list">