Hm, this is an interesting case where stylesheet design principles and application logic aren't so loosely coupled.
The data attributes almost seem to be a way to invoke CSS styles as functions themselves.
The data attributes almost seem to be a way to invoke CSS styles as functions themselves.
Enum values should map to attribute values. It makes logical sense. Attribute values don't go into a namespace. They just exist as things to query by.
It is possible many CSS engines optimize this fact. By not caching attribute values until there is a selector that uses them. Classes on the other hand are inherently saying 'I will query by this at a later time - I give no hints as to whether it is mutually exclusive with other class values. I merely have a list of class values which apply.'