Skip to content

Commit

Permalink
docs(placeholder): drop role=img and use aria-hidden for decorative S…
Browse files Browse the repository at this point in the history
…VG placeholders (#31575)

Co-authored-by: XhmikosR <[email protected]>
  • Loading branch information
ffoodd and XhmikosR authored Sep 4, 2020
1 parent fb9bf54 commit 5b37d03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/layouts/shortcodes/placeholder.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{- $show_title := not (eq $title "false") -}}
{{- $show_text := not (eq $text "false") -}}

<svg class="bd-placeholder-img{{ with $class }} {{ . }}{{ end }}" width="{{ $width }}" height="{{ $height }}" xmlns="http://www.w3.org/2000/svg"{{ if (or $show_title $show_text) }} aria-label="{{ if $show_title }}{{ $title }}{{ if $show_text }}: {{ end }}{{ end }}{{ if ($show_text) }}{{ $text }}{{ end }}"{{ end }} preserveAspectRatio="xMidYMid slice" role="img" focusable="false">
<svg class="bd-placeholder-img{{ with $class }} {{ . }}{{ end }}" width="{{ $width }}" height="{{ $height }}" xmlns="http://www.w3.org/2000/svg"{{ if (or $show_title $show_text) }} role="img" aria-label="{{ if $show_title }}{{ $title }}{{ if $show_text }}: {{ end }}{{ end }}{{ if ($show_text) }}{{ $text }}{{ end }}"{{ else }} aria-hidden="true"{{ end }} preserveAspectRatio="xMidYMid slice" focusable="false">
{{- if $show_title -}}<title>{{ $title }}</title>{{- end -}}
<rect width="100%" height="100%" fill="{{ $background }}"/>
{{- if $show_text -}}<text x="50%" y="50%" fill="{{ $color }}" dy=".3em">{{ $text }}</text>{{- end -}}
Expand Down

0 comments on commit 5b37d03

Please sign in to comment.