Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A11y shrine: missing alts attributes #361

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions templates/shrine/data/featured.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"title": "Green comfort chair",
"quote": "Leave the tunnel and the rain is fallin amazing things happen when you wait",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/chair.png",
"imageAlt": "foobar",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just use title as the alt text for imageUrl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know but I would like to show it with different values. Because if you don´t do that (my opinion), maybe people missunderstand what should be the correct value of an alt attribute (the context is important) and they think that it allways is valid with a title value you write in the page.

"storeName": "Ali’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/ali-connors.png",
"storeAvatarAlt": "foobar",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, we could just use storeName as the alt text for storeAvatarUrl.

"price": "$300",
"category": "Feature"
},
Expand All @@ -14,8 +16,10 @@
"title": "Beautiful little teapot",
"quote": "Leave the tunnel and the rain is fallin amazing things happen when you wait",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/beachball.png",
"imageAlt": "foobar",
"storeName": "Trevor’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/zach.jpg",
"storeAvatarAlt": "foobar",
"price": "$300",
"category": "Latest"
},
Expand All @@ -24,8 +28,10 @@
"title": "Original Sunnies For U",
"quote": "Leave the tunnel and the rain is fallin amazing things happen when you wait",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/chucks.png",
"imageAlt": "foobar",
"storeName": "Sandra’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/sandra-adams.jpg",
"storeAvatarAlt": "foobar",
"price": "$300",
"category": "Fashion"
},
Expand All @@ -34,8 +40,10 @@
"title": "Folding Chair",
"quote": "Leave the tunnel and the rain is fallin amazing things happen when you wait",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/lawn_chair.png",
"imageAlt": "foobar",
"storeName": "Stella’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/16c477b.jpg",
"storeAvatarAlt": "foobar",
"price": "$300",
"category": "Furniture"
},
Expand All @@ -44,8 +52,10 @@
"title": "Better wearing heels",
"quote": "Leave the tunnel and the rain is fallin amazing things happen when you wait",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/heels.png",
"imageAlt": "foobar",
"storeName": "Peter’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/peter-carlsson.png",
"storeAvatarAlt": "foobar",
"price": "$300",
"category": "Beauty"
},
Expand All @@ -54,8 +64,10 @@
"title": "Red Popsicle",
"quote": "Leave the tunnel and the rain is fallin amazing things happen when you wait",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/popsicle.png",
"imageAlt": "foobar",
"storeName": "Trevor’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/zach.jpg",
"storeAvatarAlt": "foobar",
"price": "$300",
"category": "Food"
},
Expand All @@ -64,8 +76,10 @@
"title": "Best gift for the traveler",
"quote": "Leave the tunnel and the rain is fallin amazing things happen when you wait",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/backpack.png",
"imageAlt": "foobar",
"storeName": "Sandra’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/sandra-adams.jpg",
"storeAvatarAlt": "foobar",
"price": "$300",
"category": "Travel"
}
Expand Down
32 changes: 32 additions & 0 deletions templates/shrine/data/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"title": "Vintage Bluetooth Radio",
"description": "Isn’t it cool when things look old, but their not. Looks Old But Not makes awesome vintage goods that are super smart. This ol’ radio just got an upgrade. Connect to it with an app and jam out to some top forty.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/radio.png",
"imageAlt": "foobar",
"price": "$300",
"storeName": "Sandra’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/sandra-adams.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Sandra specializes in furniture, beauty and travel products with a classic vibe. Custom orders are available if you’re looking for a certain color or material.",
"featured": false
},
Expand All @@ -15,9 +17,11 @@
"title": "Sunglasses",
"description": "Be an optimist. Carry Sunglasses with you at all times. All Tints and Shades products come with polarized lenses and super duper UV protection so you can look at the sun for however long you want. Sunglasses make you look cool, wear them.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/sunnies.png",
"imageAlt": "foobar",
"price": "$70",
"storeName": "Trevor’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/zach.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Trevor Hanson sources housewares and styles from just about everywhere. Super cool and extra awesome all of his shop’s goods are handmade with love.",
"featured": false
},
Expand All @@ -27,9 +31,11 @@
"title": "Clock",
"description": "Timekeeper Co makes clocks that tell time precisely. Clock is very simple to use, set the time using your phone, hang it, and viola! You’ll never be late again.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/clock.png",
"imageAlt": "foobar",
"price": "$120",
"storeName": "Trevor’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/zach.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Trevor Hanson sources housewares and styles from just about everywhere. Super cool and extra awesome all of his shop’s goods are handmade with love.",
"featured": false
},
Expand All @@ -39,9 +45,11 @@
"title": "Red Popsicle",
"description": "Looks can be deceiving. This Red Popsicle comes in a wide variety of flavors, including strawberry, that burst as soon as it hits the mouth. Red Popsicles melt slow, so savor the flavor.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/popsicle.png",
"imageAlt": "foobar",
"price": "$300",
"storeName": "Stella’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/16c477b.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Stella sells awesome stuff at lovely prices. made by hand and sometimes by machine, but always with love and care. Custom orders are available upon request if you need something extra special.",
"featured": false
},
Expand All @@ -51,9 +59,11 @@
"title": "Green Slip-ons",
"description": "Feetsy has been making extraordinary slip-ons for decades. With each pair of shoes purchased Feetsy donates a pair to those in need. Buy yourself a pair, buy someone else a pair. Very Comfortable.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/green-shoes.png",
"imageAlt": "foobar",
"price": "$75",
"storeName": "Sandra’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/sandra-adams.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Sandra specializes in furniture, beauty and travel products with a classic vibe. Custom orders are available if you’re looking for a certain color or material.",
"featured": false
},
Expand All @@ -63,9 +73,11 @@
"title": "Teapot",
"description": "Impress your guests with Teapot by Kitchen Stuff. Teapot holds extremely hot liquids and pours them from the spout. Use the handle, shown on the left, so your fingers don’t get burnt while pouring.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/teapot.png",
"imageAlt": "foobar",
"price": "$210",
"storeName": "Ali’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/ali-connors.png",
"storeAvatarAlt": "foobar",
"storeDescription": "Ali Connor’s makes custom goods for folks of all shapes and sizes made by hand and sometimes by machine, but always with love and care. Custom orders are available upon request if you need something extra special.",
"featured": false
},
Expand All @@ -75,9 +87,11 @@
"title": "Blue suede shoes",
"description": "Who needs pants when you have shoes! Blue suede shoes were meant to go dancing in, so you may want to pick up a few of these. These things are stylish.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/chucks.png",
"imageAlt": "foobar",
"price": "$89",
"storeName": "Trevor’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/zach.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Trevor Hanson sources housewares and styles from just about everywhere. Super cool and extra awesome all of his shop’s goods are handmade with love.",
"featured": true
},
Expand All @@ -87,9 +101,11 @@
"title": "Dipped Brush",
"description": "WeDipIt does it again. This handle dipped 4 inch brush is a perfect for painting 4 inch lines, or coloring in big areas with paint. Just be sure you don’t drop it in a bucket of red paint, then it won’t look dipped anymore.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/brush.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Stella’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/16c477b.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Stella sells awesome stuff at lovely prices. made by hand and sometimes by machine, but always with love and care. Custom orders are available upon request if you need something extra special.",
"featured": true
},
Expand All @@ -99,9 +115,11 @@
"title": "Perfect Goldfish Bowl",
"description": "The Perfect Bowl Co makes the best bowls for just about anything you can think of. This Perfect Goldfish Bowl holds water and fish perfectly. Looks great in living rooms. Keep out of reach from cats.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/fish_bowl.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Ali’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/ali-connors.png",
"storeAvatarAlt": "foobar",
"storeDescription": "Ali Connor’s makes custom goods for folks of all shapes and sizes made by hand and sometimes by machine, but always with love and care. Custom orders are available upon request if you need something extra special.",
"featured": false
},
Expand All @@ -111,9 +129,11 @@
"title": "Red Lipstick Set",
"description": "Trying to find the perfect shade to match your mood? Try no longer. Red Lipstick Set by StickLips has you covered for those nights when you need to get out, or even if you’re just headed to work.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/lipstick.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Sandra’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/sandra-adams.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Sandra specializes in furniture, beauty and travel products with a classic vibe. Custom orders are available if you’re looking for a certain color or material.",
"featured": false
},
Expand All @@ -123,9 +143,11 @@
"title": "Backpack",
"description": "This backpack by Bags ‘n’ stuff can hold just about anything: a laptop, a pen, a protractor, notebooks, small animals, plugs for your devices, sunglasses, gym clothes, shoes, gloves, two kittens, and even lunch!",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/backpack.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Peter’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/peter-carlsson.png",
"storeAvatarAlt": "foobar",
"storeDescription": "Peter makes great stuff for awesome people like you. Super cool and extra awesome all of his shop’s goods are handmade with love. Custom orders are available upon request if you need something extra special.",
"featured": false
},
Expand All @@ -135,9 +157,11 @@
"title": "Half Shield Helmet",
"description": "Half Shield is the right helmet for those warm summer days on the road. Dot approved, these helmets have been rigorously tested. Keep that noggin protected.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/helmet.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Ali’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/ali-connors.png",
"storeAvatarAlt": "foobar",
"storeDescription": "Ali Connor’s makes custom goods for folks of all shapes and sizes made by hand and sometimes by machine, but always with love and care. Custom orders are available upon request if you need something extra special.",
"featured": false
},
Expand All @@ -147,9 +171,11 @@
"title": "Beachball",
"description": "Are you at a baseball game and feeling bored? At a pool party and looking for a laugh? Do you need something to take your anger out on? Beachball, by inflatable fun, is the perfect outlet.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/beachball.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Peter’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/peter-carlsson.png",
"storeAvatarAlt": "foobar",
"storeDescription": "Peter makes great stuff for awesome people like you. Super cool and extra awesome all of his shop’s goods are handmade with love. Custom orders are available upon request if you need something extra special.",
"featured": false
},
Expand All @@ -159,9 +185,11 @@
"title": "Old Binoculars",
"description": "These Binoculars by See Through are amazing and can make things that are really far away seem like they’re right in front of you. Bring them to the beach. Now you can buy the cheap seats at the big game and feel like you’re right in the action.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/binoculars.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Stella’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/16c477b.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Stella sells awesome stuff at lovely prices. made by hand and sometimes by machine, but always with love and care. Custom orders are available upon request if you need something extra special.",
"featured": false
},
Expand All @@ -171,9 +199,11 @@
"title": "Lime Flippers",
"description": "Flippers are a nice tool to have when you’re being chased by an oversized sea turtle. Never get caught again with these fast water shoes. You’re like a fish, but more graceful.",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/flippers.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Peter’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/peter-carlsson.png",
"storeAvatarAlt": "foobar",
"storeDescription": "Peter makes great stuff for awesome people like you. Super cool and extra awesome all of his shop’s goods are handmade with love. Custom orders are available upon request if you need something extra special.",
"featured": true
},
Expand All @@ -183,9 +213,11 @@
"title": "Surfboard",
"description": "Who says you can’t walk on water? With Surfboard, by Surfboard Supply, you can fly on water. This beast is fast and handles like a porsche. Hang Ten Bro!",
"imageUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/surfboard.png",
"imageAlt": "foobar",
"price": "$25",
"storeName": "Stella’s shop",
"storeAvatarUrl": "https://www.gstatic.com/angular/material-adaptive/shrine/16c477b.jpg",
"storeAvatarAlt": "foobar",
"storeDescription": "Stella sells awesome stuff at lovely prices. made by hand and sometimes by machine, but always with love and care. Custom orders are available upon request if you need something extra special.",
"featured": true
}
Expand Down
2 changes: 1 addition & 1 deletion templates/shrine/src/shrine-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
<app-drawer id="drawer" swipe-open>
<template is="dom-if" if="[[smallScreen]]">
<app-toolbar class="profileBar">
<img class="profilePic" src="//app-layout-assets.appspot.com/assets/shrine/profile_pic.jpg" width="30" height="30">
<img class="profilePic" src="//app-layout-assets.appspot.com/assets/shrine/profile_pic.jpg" width="30" height="30" alt="">
<div class="profileName">Stella</div>
<paper-icon-button icon="settings"></paper-icon-button>
</app-toolbar>
Expand Down
1 change: 1 addition & 0 deletions templates/shrine/src/shrine-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ <h3>[[item.storeName]]</h3>
_itemChanged: function(item) {
this.$.img.src = '';
this.$.img.src = item.imageUrl;
this.$.img.alt = item.imageAlt;
}

});
Expand Down
3 changes: 2 additions & 1 deletion templates/shrine/src/shrine-featured-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<div class="desc">
<p>[[item.quote]]</p>
<div class="author">
<img src="[[item.storeAvatarUrl]]">
<img src="[[item.storeAvatarUrl]]" alt$="[[item.storeAvatarAlt]]">
[[item.storeName]]
</div>
</div>
Expand All @@ -201,6 +201,7 @@
this.style.visibility = item && item.title ? 'visible' : 'hidden';
this.$.img.src = '';
this.$.img.src = item ? item.imageUrl : '';
this.$.img.alt = item ? item.imageAlt : '';
}

});
Expand Down
4 changes: 2 additions & 2 deletions templates/shrine/src/shrine-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@

</style>

<div class="pic" style$="background-image: url([[item.imageUrl]]);"></div>
<img class="pic" src="[[item.imageUrl]]" alt$="[[item.imageAlt]]">
<div class="link">[[item.title]]</div>
<span class="price">[[item.price]]</span>

<div class="author">
<img src="[[item.storeAvatarUrl]]">
<img src="[[item.storeAvatarUrl]]" alt$="[[item.storeAvatarAlt]]">
[[item.storeName]]
</div>

Expand Down
2 changes: 1 addition & 1 deletion templates/shrine/src/shrine-simple-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

</style>

<div class="pic" style$="background-image: url([[item.imageUrl]]);"></div>
<img class="pic" src="[[item.imageUrl]]" alt$="[[item.imageAlt]]">

</template>

Expand Down