Adam Wathan - Tailwind CSS Best Practice Patterns

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 102

  • @KlippiesNBiltong
    @KlippiesNBiltong 5 років тому +38

    Tailwindcss opened the idea that you can actually do css yourself. You don't have to live inside the bootstrap box and now you are able to look outside. Adam is the man!

  • @NortheastGamer
    @NortheastGamer 4 роки тому +38

    Extract components, not classes: 4:29
    No Sass? No problem: 9:55
    Use SVG like it's going out of style: 13:55
    Don't be afraid to extend the framework: 20:02
    Prefer inline styles to weird custom classes: 25:27
    Remove unused classes with Purgecss: 28:48

  • @maxgeorgopoulos3516
    @maxgeorgopoulos3516 4 роки тому +17

    Tailwind is so powerful. I now do 90% of my design with tailwind (10% in Figma)

  • @olivierbassin286
    @olivierbassin286 5 років тому +8

    Adam is such an upbeat dude, listening to him always helps me find motivation for anything.

    • @brandon5058
      @brandon5058 5 років тому +1

      Olivier Bassin me too! After listening to this talk i finally survived no nut november

  • @luismoriguerra669
    @luismoriguerra669 3 роки тому +6

    tailwind is an API for your design system, and only that makes it amazing 👏️

  • @nicolaskeith8872
    @nicolaskeith8872 4 роки тому +7

    "Beautiful blob, designed by my beautiful friend Steve."
    Oh, Adam, you keep me young

  • @sivuyilemagutywa5286
    @sivuyilemagutywa5286 5 років тому +11

    Ever since I started using Tailwind, I actually enjoy CSS, Easy to customize the framework

  • @Andrey-il8rh
    @Andrey-il8rh 3 роки тому +2

    The great talk I stumbled upon only now. It's really nice to see how much Tailwind evolved over these 2 years and some of the stuff such as long compilation times, "no animations", not able to apply arbitrary values per breakpoint, html duplications just for responsive reasons, all of this stuff is no longer the case in the new version of Tailwind and each day some new improvement is on the horizon. Great work, Gendalf Adam! 🧙🏻‍♂️

  • @mischl1
    @mischl1 5 років тому +3

    @AdamWathan Thanks for giving us a bit of insight into how you work! Awesome talk!

  • @BibeshManandhar
    @BibeshManandhar 4 роки тому +6

    The second last trick is awesome.
    Actually the whole video is awesome 😍😍

  • @DrewRoberts
    @DrewRoberts 5 років тому +8

    I'm allergic to CSS, but Tailwind CSS does not have those same side effects.
    Once you get over having hundreds of class names, you will love your new allergy free lifestyle. I highly recommend checking it out if you're on the fence with utility-first CSS frameworks.

    • @insanecuckooman8342
      @insanecuckooman8342 4 роки тому +1

      how id using hundreds of class names, better than just using css. tailwind is inline css with extra steps.

    • @Andrey-il8rh
      @Andrey-il8rh 3 роки тому

      @@insanecuckooman8342 you should really think about changing profession, they say that rolling burgers is still in high demand

  • @cyberloh
    @cyberloh 4 роки тому +2

    this guy rocks! for the whole my life i hated css before finding tailwind

  • @thekwoka4707
    @thekwoka4707 3 роки тому +5

    The second to last point about inline styles isn't an issue anymore with the JIT module for Tailwind. You can put arbitrary values on the normal class name with breakpoints and whatever however you want.

  • @tamrat_assefa
    @tamrat_assefa 2 роки тому +2

    That SVG trick was neat. ViewBox is the boss!

  • @heyjordn
    @heyjordn 4 роки тому +3

    This talk was so awesome!

  • @tcindie
    @tcindie 5 років тому +5

    What is the browser/tool in use next to the IDE with the breakpoints/etc built in? Is that a vscode plugin?
    Would love to find this is looks incredibly useful

    • @drehimself
      @drehimself 5 років тому +6

      sizzy.co

    • @LenWoodward
      @LenWoodward 5 років тому +1

      When we was alt-tabbing it looked to me like it called Sizzy. I defs paused to write it down. In some of his other screencasts he's used a chromium based browser named Polypane as well.

    • @tcindie
      @tcindie 5 років тому

      Thanks guys. :)

  • @himbary
    @himbary 4 роки тому +2

    He is such a cool guy

  • @delulu6969
    @delulu6969 3 роки тому

    The diagonal shape can be done with clip-path much easier and appropriate. I use Tailwind but for that kind of customization it's better to include plain CSS.

  • @versastudio9198
    @versastudio9198 4 роки тому

    Excellent talk, super helpful.

  • @RandomGuy1606
    @RandomGuy1606 5 років тому +5

    I can actually get design feedback building the actual html/css with tailwind and hot reloading than I can building the design mocks in Figma or Sketch

    • @maxgeorgopoulos3516
      @maxgeorgopoulos3516 4 роки тому

      Same here. Since using tailwind, I do 90% of my designing in HTML&CSS.

  • @ProgrammingwithPeter
    @ProgrammingwithPeter 5 років тому

    Great talk, i'm thinking of using Tailwind on my youtube series .

  • @ashleyredman
    @ashleyredman 4 роки тому

    Generally I don't usually go to use purge css incase of removing styles that are on events or not active on a build, but I guess with tailwind is more or less everything is applied through a class or inline then it makes much more sense, will try this out! Thanks

  • @mohammadpartovi1813
    @mohammadpartovi1813 4 роки тому

    Fantastic!

  • @mikeyura
    @mikeyura 3 роки тому +6

    What is that browser he's using?

    • @sebastiangon11
      @sebastiangon11 3 роки тому +3

      It's Sizzy

    • @iamthekingofchoco
      @iamthekingofchoco 2 роки тому +1

      @@sebastiangon11 arrrgh it’s paid

    • @jantube358
      @jantube358 2 роки тому

      @@iamthekingofchoco woah $499 for a one-time purchase is a no

  • @atomtopa
    @atomtopa 3 роки тому +1

    I am finally sold.

  • @anstapol
    @anstapol 3 роки тому +1

    How you deal with code splitting? Or you just loading all of your style on all pages?

    • @Andrey-il8rh
      @Andrey-il8rh 3 роки тому +2

      since in most cases purged tailwindcss version is no more than 10kb gzipped there is no special reason to split it in chunks. You can just inline it in head and view it as critical css

  • @michaelwarren2100
    @michaelwarren2100 3 роки тому +1

    How do you ensure the blob goes behind the image and the text?

    • @hellobye9049
      @hellobye9049 3 роки тому +3

      position: absolute and a low z-index if you need it.
      example using tailwind classes " "

  • @jma42
    @jma42 2 роки тому

    Does 11:12 solve the class naming problem like css modules does?

  • @rolanddecasa4438
    @rolanddecasa4438 4 роки тому +2

    yeah ur right man! love tailwind 27:15

  • @gitarthakashyap8519
    @gitarthakashyap8519 4 роки тому +1

    Apply 5:37

  • @kevinnacario359
    @kevinnacario359 3 роки тому

    the best

  • @tanzimibthesam5861
    @tanzimibthesam5861 5 років тому +3

    So no more Bootstrap?

    • @КонстантинС-ж1ы
      @КонстантинС-ж1ы 5 років тому +11

      I think bootstrap is a great choice when you need to build something fast and don't care about custom design. But when your project requires unique design, tailwind will better imho.

    • @Booyamakashi
      @Booyamakashi 5 років тому +1

      @@КонстантинС-ж1ы Yep. Exactly.

    • @med5032
      @med5032 5 років тому

      @@КонстантинС-ж1ы Not really. fast = tailwind.

    • @JohnSmith-zl8rz
      @JohnSmith-zl8rz 4 роки тому +3

      Bootstrap always was shit!

    • @Andrey-il8rh
      @Andrey-il8rh 3 роки тому

      Bootstrap can't be compared to TW it's like bananas and marshmallow

  • @ekmanhsieh
    @ekmanhsieh 5 років тому +4

    Nice vidoe!Has anyone can tell me, right side of screen software or extension is?

  • @ramazanaktas3699
    @ramazanaktas3699 4 роки тому

    Which editor is he using?

    • @dwainetrain
      @dwainetrain 4 роки тому +2

      Looks like VS Code. For the screen on the right, I think he's using Sizzy. sizzy.co/

    • @ramazanaktas3699
      @ramazanaktas3699 4 роки тому

      @@dwainetrain Thanks for your comment, and I checked out Sizzy. It really looks useful but I found prices expensive. I just wondered that live preview, and found an extension called Browser Preview and will preview mobile just through a Chromium-based browser. Thanks again.
      Edit: Somehow, it doesn't work, maybe I got something wrong.

    • @699088g
      @699088g 4 роки тому

      @@ramazanaktas3699 its just a split view mode in macOs

  • @andresfrr100
    @andresfrr100 3 роки тому +3

    It´s a BEM murder.

  • @anticom1337
    @anticom1337 5 років тому +3

    Does anyone know what this browser preview thing is on the right side of his screen?

    • @luthfitriatmaja3709
      @luthfitriatmaja3709 5 років тому +11

      That's Sizzy

    • @anticom1337
      @anticom1337 5 років тому

      @@luthfitriatmaja3709 Thanks!

    • @ahmadkhudai
      @ahmadkhudai 4 роки тому

      @@luthfitriatmaja3709 thank you! I was going to ask the same thing

  • @rajeevdsamuel
    @rajeevdsamuel 3 роки тому +2

    If you want a front-end developer job you are still going to have to learn css

    • @trkishh
      @trkishh 3 роки тому +17

      You have to learn CSS first before you can even use Tailwind. You have to know CSS before you can utilize or know what any of the classes do.

  • @MrAtomUniverse
    @MrAtomUniverse 4 роки тому

    5:40 isn't this like CSS

    • @Rendxn
      @Rendxn 4 роки тому

      Yes, but you are using the @apply directive to apply tailwind classes inside your btn class

    • @designdust
      @designdust 4 роки тому +3

      @@Rendxn well then just use raw CSS or SASS instead of bombarding your markup with @apply directive.

    • @gustavovasquezveliz7046
      @gustavovasquezveliz7046 3 роки тому

      @@designdust @apply may be the awful thing of tailwind, but using it does not mean you will need to remove tailwind and go for raw css

  • @uxcoda8806
    @uxcoda8806 5 років тому +2

    Awesome talk but duplicating an SVG instead of creating a custom class to handle media queries. That's sacrilege!

    • @Booyamakashi
      @Booyamakashi 5 років тому +2

      Sara Soudain, SVG guru, tweeted recently that she is inlining 99% of the times.

    • @ClintonGreen77
      @ClintonGreen77 5 років тому

      @@Booyamakashi yeah I'm totally for inlining SVGs. I just can't get behind duplicating an SVG to look different on different breakpoints. That goes against responsive design.

    • @med5032
      @med5032 5 років тому +1

      gzip, my friend. duplication there is sound and sensible.

    • @ClintonGreen77
      @ClintonGreen77 5 років тому

      @@med5032 Yeah gzip is the shizz. Good idea.

    • @IfanIqbal
      @IfanIqbal 4 роки тому

      I think Adam just want to show us that specific use case when we could only inlining styles. Tailwind CSS itself has responsive utility for size and position. Maybe, he decided not to demonstrate it for a reason.

  • @PrinjuVaidyan
    @PrinjuVaidyan 3 роки тому

    I think this is making html very vague

    • @madsouris
      @madsouris 3 роки тому +1

      it feels like writing XAML in a way, but it's class instead of attribute..
      Bad idea for static HTML and CSS writing, but best idea imo when we start using component and don't repeat ourselves.

    • @noobslayer9291
      @noobslayer9291 3 роки тому

      bruh its just bootstrap and no brainer

    • @Andrey-il8rh
      @Andrey-il8rh 3 роки тому

      ua-cam.com/video/fBDifUjNzbQ/v-deo.html

  • @perfect.stealth
    @perfect.stealth 3 роки тому +2

    I don't understand what the hype is about. It really doesn't solve any problem

    • @scriptkeeper8243
      @scriptkeeper8243 3 роки тому +3

      faster and smarter, CSS is probably the most illogical way of doing anything TW seems to help move it into being more organized.

    • @klarnorbert
      @klarnorbert 3 роки тому +1

      @@32fw34dgasdfg Sass and Less already solved those problems. You don't need a single CSS framework these days.

    • @xucongzhan9151
      @xucongzhan9151 3 роки тому +1

      @@klarnorbert Not really. With SASS and Less, you still have to intentionally build out your utilities manually. It's much much more work. It's essentially building your own CSS framework. And more often than not, people just get lazy and fall back to those semantic CSS class names like confirmation-modal-body/reset-password-modal-body, etc. and define margins/paddings/font-sizes manually in those classes. 24px here and 20px there. Those are hardly any better than using plain CSS. Maybe nesting? I've worked on projects with SASS and Less, and no they are not as convenient, at all.

    • @klarnorbert
      @klarnorbert 3 роки тому

      @@xucongzhan9151 Sure, you're right. But those css prepocessors solved the issues with scalability and maintainablity. Sure, you need to wrote your own "framework", but it's really easy to do these days with grid and flexbox. Bootstrap solved issues when there was no grid and flexbox. Btw who still using pixels? lmao Also there's BEM, that you can use to name your classes.

    • @Andrey-il8rh
      @Andrey-il8rh 3 роки тому +4

      @@klarnorbert what if I tell you that all of these fancy tools are not needed when you have TW?