components icon indicating copy to clipboard operation
components copied to clipboard

refactor: prefer native [disabled] over [data-disabled] for styles ta…

Open LimeWub opened this issue 1 year ago • 1 comments

…rgeting disabled state

This is more of a suggestion PR as nothing is currently breaking due to it, but I think it will be a good change for the codebase.

After fixing TileInteractive's disabled state which was wrongly targeting [data-disabled], I'm also applying the same changes to all other components with disabled styles.

The point is, [data-disabled] is a radix data attribute but it will always for accessibility/functionality ALSO be adding the disabled native attribute. So we could be targeting either with no issues. Thus targeting [data-disabled] is mudding the waters when it comes to copying around styles - like I had done for TileInteractive(which is actually just a native button and not a radix component) a few months ago.

If we agree to only be targeting [disabled] from now on, these sort of bugs will be avoided and components' css will be more solid as they wont be depending on a radix attribute.

LimeWub avatar Feb 19 '24 10:02 LimeWub