Jason Knight
Nov 12, 2023

--

As or non-screen media users disabled buttons basically don't exist, that should be the usage scenario for it. When you don't want it to exist.

It is annoying sometimes removing them entirely because it can screw up layout flow. It's nice still having them in there for that reason.

Solution?

[disabled] { visibility:hidden }

If it's disabled, hide it for screen users. Problem solved. Again it's already not there for non-screen users... well, excepting perhaps print so send it to both.

MIGHT be one of the few cases I'd ever allow media="all".

Same as how option[disabled] { display:none; } is a godsend when you have things that filter out options.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet