Use colors, but never rely solely on colors, as some people might not be able to distinguish them. This is the essence of success criterion WCAG 1.4.1 (A) for accessible design. Inactive components are also mentioned in 1.3 Contrast (minimum), increasing the recommendation of avoiding disabled elements.
Sort: