{"id":325332,"date":"2020-11-10T15:45:00","date_gmt":"2020-11-10T23:45:00","guid":{"rendered":"https:\/\/css-tricks.com\/?p=325332"},"modified":"2020-11-10T15:45:03","modified_gmt":"2020-11-10T23:45:03","slug":"aria-in-css","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/aria-in-css\/","title":{"rendered":"ARIA in CSS"},"content":{"rendered":"\n

Jeremey reacting to Sara’s tweet<\/a>, about using [aria-*]<\/code> selectors instead of classes when the styling you are applying is directly related to the ARIA state.<\/p>\n\n\n\n

… this is my preferred way of hooking up CSS and JavaScript interactions. Here\u2019s [an] old CodePen<\/a> where you can see it in action<\/p><\/blockquote>\n\n\n\n

Which is this classic matchup:<\/p>\n\n\n\n

[aria-hidden='true'] {\n  display: none;\n}<\/code><\/pre>\n\n\n\n\n\n\n\n

There are plenty of more opportunities. Take a tab design component:<\/p>\n\n\n\n