Closed sjmog closed 9 years ago
We've discussed and are all happy (as is Arfa) , although we're going to change the names to atoms -> groups -> templates. Me, Roi and Steve are going to work renaming and adding documentation and generally start turning this into something we can prototype for the beta site.
I'm just being nitpicky with my comments! Otherwise I actually quite like where this is going.
OK gang, what do we think? Please read this before checking code
Recap of the main reasoning:
Top Level
Non-developers can build interfaces using a very easy syntax. Here is an example (the 'meet our grads' block) from
homepage.erb
:Molecule partials are very specific. When a user renders a partial called
media-component--with-slider
, they know exactly what they're getting, and there is a standard set of attributes for them to fill in.Bottom level
Developers can build new molecules using atoms. These atoms are very generic. Here is the
cta-block
atom, which renders any number of Calls to Action (buttons) in a supplied configuration:Any component (except molecule components) is rendered by including two main attributes:
parent
(a string), andmodifiers
(an array of strings).So, to render the
cta-block
above:If you provide a
parent
and amodifiers
array, the builder will include the correct BEM classes for you (see theComponentClassesHelper
inlib
). If you don't include these, the BEM helper will still work and you will render the most generic form of a component.Atom and Quark partials are very generic. They accept a wide range of (sensibly-named) attributes, and my next task will be to document them.
Between Molecules and other Components
Molecule partials (go check out
components/molecules/_media-component--with-slider.erb
) should:OK, I think that's enough. If there's anything here that doesn't make sense, please grab me. As Roi will testify, this is easier to get your head round than it might seem, and it hits each point of the main reasoning well.