CrankShaft icon indicating copy to clipboard operation
CrankShaft copied to clipboard

CSS Class Namespacing

Open TheWebTech opened this issue 7 years ago • 3 comments

Our classes should probably be prefixed to ensure we don't conflict with commonly used class names.

Example: All class names in crankshaft could be prefixed with.cs-

I think that feels long and would get tedious, but would be less likely to conflict. Anyone else got suggestions?

TheWebTech avatar Oct 24 '18 14:10 TheWebTech

I say that they should follow a bem style configutation

** tabs module **

.tab-module {}
.tab-module__tab {}
.tab-module__tab--active {}
.tab-module__panel {}
.tab-module__panel--active {}

adesignl avatar May 09 '19 15:05 adesignl

name space for specific module not the framework

adesignl avatar May 09 '19 15:05 adesignl

I agree with BEM. you may be right about namespacing not being super important, bootstrap's approach is

"We give you these base elements, you decide to use the same class names as us, that's your problem deal with it."

I do think namespacing the modules like you said is an absolute must.

What I want to do is get a guideline doc/wiki page or documentation site page going with best practices for building custom modules. Not all of them would necessarily be best practices for the framework itself some might simply be best practices for module development in general. Like namespacing the module classes and css. BEM usage.

TheWebTech avatar May 09 '19 15:05 TheWebTech