I have a large project, structuring its CSS architecture via ITCSS. All in all, I love it. However, I have one issue when styling forms.
I've styled different form elements in my elements layer:
in forms.scss:
input[type="text"], input[type="password"] {
// sexy element styles
}
However, if I have a component that needs different styling:
in foo_component.scss:
.c-foo__text, .c-foo__password {
// sexy component styles
}
Due to the selectivity of the input type in forms.scss, my component styles in foo_component.scss
do not override the element styles in forms.scss
.
The current refactor I'm thinking of is changing forms.scss
to an object:
form_object.scss refactor:
.o-form__text, .o-form__password {
// sexy object styles that will be overwritten by the lower component
}
I was wondering if this is a proper convention, or is there a better solution?