e.g. for the modular approach, the ideas of Atomic Design helps me alot. bradfrost.com/blog/post/atomic-web...
and BEM for styling (CSS) this different building blocks. css-tricks.com/bem-101/
e.g. a Button Atom
.a-btn {...} .a-btn__icon {...} .a-btn--active {...}
Edit: in my last project I used often the data attribute instead BEM modifiers.
like
<a class="a-btn" data-disabled data-size="small" />
.a-btn[data-disabled] {....} .a-btn[data-size="small"] {....}
Data attributes are often easier to set/modify with javascript than CSS classes. Additional they are an interesting solution to manage component state in the DOM.
Agreed, depending on the project (especially when it comes to personal projects), I even structure it based on Atomic Design, it really helps !
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
e.g. for the modular approach, the ideas of Atomic Design helps me alot.
bradfrost.com/blog/post/atomic-web...
and BEM for styling (CSS) this different building blocks.
css-tricks.com/bem-101/
e.g. a Button Atom
Edit:
in my last project I used often the data attribute instead BEM modifiers.
like
Data attributes are often easier to set/modify with javascript than CSS classes. Additional they are an interesting solution to manage component state in the DOM.
Agreed, depending on the project (especially when it comes to personal projects), I even structure it based on Atomic Design, it really helps !