Is there any problem creating a CSS class like this:
[test] { font: 13px; }
and use it in an HTML attribute as this:
Your custom attributes are not valid HTML. You must use data-*
attributes if you want to put custom data on your elements. This makes what you are doing bad practice.
In addition, there are CSS classes already that should meet your needs, unless there is more to your question than you have described.