Skip to content

Commit

Permalink
fix: adding comment to explain the need for the alt attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mbleuer committed Apr 22, 2024
1 parent 44d1b2e commit ade920a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/image/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ export class SbbImageElement extends LitElement {

const pictureSizeConfigs = this._preparePictureSizeConfigs();

/**
* The alt attribute should always be present for the img element.
* If it has an empty string as its value, it is simply ignored
* by assistive technologies. If we leave it out completely,
* they might try to interpret the img element.
*/
return html`
<figure
class=${classMap({
Expand Down

0 comments on commit ade920a

Please sign in to comment.