maintainablecss.com-jekyll icon indicating copy to clipboard operation
maintainablecss.com-jekyll copied to clipboard

module vs component - why not both?

Open georgir opened this issue 7 years ago • 1 comments

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{...}

georgir avatar May 03 '18 16:05 georgir

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)

adamsilver avatar May 04 '18 13:05 adamsilver