May 19, 2023
You could, but that doesn't mean that you should.
Data attributes are meant for Javascript to store and read data in the element.
It's like nobody would use img[src="logo.png"] to style a particular element. It works, but it's not meant to be a replacement of ID and Class :)