Home › Forums › CSS › CSS styling which way is better › Reply To: CSS styling which way is better
December 27, 2015 at 5:25 am
#236186
Paulie_D
Member
Firstly…don’t do this:
.color-white {
color: white;
}
Class names shouldn’t be that specific…what if you decide to change the color to red...color-white
doesn’t make a lot of sense then.
As for what’s best…that’s entirely up to you…there are whole books on naming schemes and conventions…BEM, SMACCS etc.
If your CSS selector is specific (enough) you often don’t need a class at all.