maintainablecss.com-jekyll
maintainablecss.com-jekyll copied to clipboard
module vs component - why not both?
In section 6, modules, the "Modules vs components" subsection could mention the two are not exclusive of each other. Nested modules are essentially also components and should have both classes.
I.e. you could have class "button" and "checkout-nextStepButton" at once... then have styles that apply for all buttons on .button{...} and those that differentiate this specific button on .checkout-nextStepButton{...}
Yes, I think that's a fair point, though I'd like to think through some of the problems that may come out of such an approach.
Thinking aloud, it might be that the class name on the button could/should just be .checkout-nextStepButton and that the .button is added via a mixin (or equivalent).
I'd also like to note that the words Module and Components are often used interchangeably, and so I'm thinking about sorting out the nomenclature.
Perhaps:
- Component (instead of module)
- Element (instead of component)