I am creating a stylesheet inspired by ITCSS, BEM, and OOCSS and am unsure how to separate structure properties from cosmetics properties.
An example as I understand ITCSS and OOCSS:
//First the structure. Button is an object (ITCSS)
.o-btn {
height: ...;
width: ...;
}
//Then declare the cosmetics in components
.c-btn-login {
background: ...;
color: ...;
...
}
What I have problems to see are more related with ITCSS. Two different prefixes (two categories) for the same element, when I could have the same prefix for the same element, and probably be more clear to understand.
Is this approach correct?
In my opinion I think the
c-btn-login
way is wrong. In this case the component is the form.With this structure you can apply cosmetic styles with the
t-form-dark
class for all component children or use a specific class for a child liket-btn-dark
.