WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: aria-controls breaks CSS?

for

From: Birkir R. Gunnarsson
Date: Apr 5, 2019 4:18PM


aria-controls inherently has no effect on CSS, but it is convenient
target for CSS classes since it identifies the element affected by
pressing the button.
I recommend using aria-controls if activating or changing the setting
of an element changes content that is no immediately inline to that
element, e.g. when clicking "add to cart" button updates the total
price (assuming it is on the page and visible) or when checking a
checkbox or selecting a radio button dynamically displays content
further down the page.
And, yes, you are right that support for aria-controls is very
rudamentary so you can't use it as the only means to communicate
information.



On 4/5/19, Patrick H. Lauke < <EMAIL REMOVED> > wrote:
> On 05/04/2019 21:28, David Engebretson Jr. wrote:
> [...]
>> If I remove aria-controls it breaks our CSS. Why would aria-controls
>> alter
>> the CSS?
>
> Probably because your CSS is taking advantage of the aria-controls
> attribute in some form of attribute selector, a la
>
> button[aria-controls] { ... }
>
> P
> --
> Patrick H. Lauke
>
> www.splintered.co.uk | https://github.com/patrickhlauke
> http://flickr.com/photos/redux/ | http://redux.deviantart.com
> twitter: @patrick_h_lauke | skype: patrick_h_lauke
> > > > >


--
Work hard. Have fun. Make history.