3 ms·
Exactly. Every time you find yourself doing copy paste for a whole range of elements, introduce a component with its own collection of style classes.
by blowski 6y ago
Exactly. Every time you find yourself doing copy paste for a whole range of elements, introduce a component with its own collection of style classes.
- ehnto 6y agoYes, that would work well if you are using a frontend JS framework.
- blowski 6y agoYou can achieve the same thing with SSR frameworks as well. e.g. ``` {{ recent_blog_posts(blogPosts) }} ``` can be a function that expands to: ``` <aside class="border-pink border-1 rounded bg-orange"> {% for post in blogPosts %} <li class="text-underline text-purple font-list">...</li> {% endfor %} </aside> ```