Design in the browser
Style the real element directly and skip the naming step.
Adam Wathan@adamwathanOne of my first projects for the new year is going to be a "Designing with @tailwindcss" video course, which will help you learn Tailwind as a tool, as well as how to use it to design in the browser and actually implement common components and layouts ๐๐ป Price: $0 ๐๐ป
Adam Wathan@adamwathanโจ I rebuilt Coinbase with @tailwindcss and turned it into a @CodePen! No config changes, no custom CSS ๐ ๐ป
Adam Wathan@adamwathanEnded up here, not bad for a couple of hours of work and writing no CSS ๐๐ป
Demo counts your steps live: one per toggle, three per try with a stylesheet.
Try a style
Toggle a class on each card.
Name, save, reloadBad
Edit the markupGood
<div class="rounded-2xl p-6 shadow-lg ring-1 uppercase">
Pro plan
</div>
Why it matters, pros and cons
Why it matters
Styling in the markup keeps the loop at one step. You judge the real element, not a name you had to invent first.
Pros
- Each try is one edit, and you see the real result at once.
- No stylesheet to open, no class name to think up.
- Changes stay on the element, so nothing else moves.
Cons
- Long class lists in markup take some getting used to.
- Repeated pieces need a component once the list is copied.
- A quick mock-up may not need a real design pass.