Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the naming convention for CSS classes for styling and for events?

What is a smart way to name CSS classes to be able to distinct between those used for styling and those for JS events?

Looking at a div with 4 CSS classes, it would speed things up for me, if I could see if the class is used for only styling or only design, to reduce debugging-time.

I know I can start prefixing all CSS-style classes with style_, but is there a better way, that's maybe are a convention too?

like image 558
radbyx Avatar asked Dec 14 '22 22:12

radbyx


1 Answers

Just use "js-" in the begining of all classes used for JS events.

like image 75
PB101 Avatar answered Dec 21 '22 09:12

PB101