I am creating a button component using aria-disabled
for managing disabled state instead of disabled
attribute to accommodate accessibility requirements.
Earlier I used CSS pseudo-class :disabled
to style the disabled component. Is there a way to use it with aria-disabled="true"
to style the button and aria-*
attributes in general?
Just apply an attribute selector instead of :disabled
:
[aria-disabled="true"] { /* your declarations */ }