I'm quite a beginner and because I'm trying to make a small UI (Html,CSS only) I came across following question:
I started styling the buttons using my own html-attributes and checking their value in my css-code: Dependent on which value the attribute has, the button gets a different style and/or behaviour:
HTML I'm using
<button button-color="green" button-hover="blur">Green</button>
CSS I'm using
/* the default-style of any button */
/* additions (sth. like other color etc.) */
/* blur-hover effect of the green button */
This code is working perfectly, but I'm wondering if that what I'm doing is bad practice. I know that I could do that all using classes: e.g. creating a class ".green-button-blur-hover" and create a button with the attribute class="green-button-blur-hover".
But that could end in a lot of classes and might be more confusing that what I'm just doing. So, what's your opinion? Can I continue styling my UI using my own attributes or is this bad practice?