How I got married to
tailwindcss Klaus Fischer klaus@supersimple.at @klausinger
Slide 2
Goal
Slide 3
Motivate 3 people to try tailwind!
Slide 4
How is the motivation happening? (Agenda) 1. What is tailwind? 2. What problems does it solve? 3. How did I get convinced? 4. Quickstart 5. Future & Improvements
Slide 5
What is tailwind? A utility-first CSS framework for rapidly building custom designs.
Slide 6
WTF Utility-first
Slide 7
Slide 8
Slide 9
Slide 10
Slide 11
High and DRY
Slide 12
#soDRY
Slide 13
Slide 14
Slide 15
What problems does tailwind solve?
Slide 16
Scope: Think less when styling ‐ Classes instead of CSS properties <span class=”text-primary”> Importante! </span> .text-primary { color: red; line-height: 1.25; }
<span class=”text-red leading-tight”> Importante! </span>
Establish flexible design systems ‐ Declare your design system/styleguide in tailwind.config.js ‐ Atoms → Components ‐ Build combos for repeating elements (e.g. forms) <input type=”text” class=”tw-input”> .tw-input { @apply px-4 py-3 border border-gray-400 appearance-none; }
Slide 19
It’s CSS only! ‐ No JS components → Use it with your favorite jQuery version JS framework 😉 ‐ Do one thing and do it well ‐ Less cognitive connection between CSS and JS, easier onboarding ‐ More utility-based CSS frameworks: tachyons, …
Slide 20
How did I get convinced?
Slide 21
History lesson! ‐ Bootstrap :( there has to be something better! ‐ uikit 2 → uikit 3 ‐ Utility based → tachyons? ○
👍 Minimalism, typo 👎 Maintenance
‐ Stick with uikit 3
Slide 22
“We really should try that new thing!”
Slide 23
Make a sustainable choice I won’t regret.
Slide 24
Sustainable choice, huh? ‐ Perf: Generate ALL the classes → purgecss ‐ Low risk project (budget, few tech. unknowns, low maintenance) ‐ Take the time to learn ‐ Encourage enthusiasm ‐ Decide afterwards
Why PostCSS? ‐ more modular than scss ‐ postcss-preset-env (!!!) ‐ CSS custom properties a.k.a. CSS Variables, imports, nesting
Slide 29
Workflow ‐ Half a day to make it work ‐ VSCode plugin as cheatsheet ‐ Designs → extract design system → typo, colors, spacings ‐ tailwind.config.js overrides ‐ Start building!
Slide 30
tailwindcss Quickstart
Slide 31
tailwindcss Quickstart ‐ Start plain or add to your setup ‐ Don’t panic, use the force search! (it’s really good) ‐ IDE Plugin / Cheatsheet ‐ Component-based approach ‐ Grid, Typography, Spacings (Sample Markdown) ‐ Give yourself some time!
Summary 1. What is tailwind? utility-based 2. What problems does it solve? scope, variants, focused 3. How did I get convinced? Low risk, purgeCSS, enthusiasm 4. Quickstart: pick a project, search docs, IDE plugin 5. Take some time and try it!
Slide 36
Hope you’ve enjoyed, try it! Wanna code tailwind or something else? klaus.fischer@netural.com
Klaus Fischer @klausinger
Slide 37
STOP CSS NOW, TALK JS Wanna code tailwind or something else? klaus.fischer@netural.com
Klaus Fischer @klausinger