This Prettier Plugin Makes Tailwind So Much Better

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024

ความคิดเห็น • 173

  • @realdiegor
    @realdiegor ปีที่แล้ว +196

    WOW, it wasnt a big problem, it was my MAIN problem. hehe. Thanks for sharing Kyle

  • @aram5642
    @aram5642 ปีที่แล้ว +39

    In frontend we're so good at solving problems we've created for ourselves by choosing to use YAF (Yet Another Framework) that then turns out to need YAP (Yet Another Plugin) for YAF in order to tame the annoyances.

    • @StabilDEV
      @StabilDEV 10 หลายเดือนก่อน +2

      While this critique might generally be valid it does certainly not apply to tailwind

    • @gerooq
      @gerooq 4 หลายเดือนก่อน

      I agree for the most part but I like to believe that there is a general uptrend in DX even if the line is more stair-step than straight.
      I think the JS ecosystem was unfortunate in that the demand for more and more complex web applications superseded the progress in developer tooling.

    • @VitoSolin0
      @VitoSolin0 3 หลายเดือนก่อน

      🤣🤣

  • @shakapaker
    @shakapaker ปีที่แล้ว +277

    WARNING! Do not use "prettier-plugin-tailwindcss" and "eslint-plugin-tailwindcss" simultaneously; it caused unreal lags in VSCode and I wasted a week resolving it. I recommend using the plugin for ESLint if you are using ESLint in your project.

    • @vasylperehinets8562
      @vasylperehinets8562 ปีที่แล้ว +1

      yeah, I had the same problem

    • @mooza.shorts
      @mooza.shorts ปีที่แล้ว +5

      Someone should open an issue

    • @StabilDEV
      @StabilDEV 9 หลายเดือนก่อน +1

      Why do you prefer the eslint plugin?

    • @MobinurRahaman
      @MobinurRahaman 8 หลายเดือนก่อน +1

      @monotype1110 Does this issue exist now?

    • @a-factoracademy
      @a-factoracademy 5 หลายเดือนก่อน +2

      I should have read earlier!😢

  • @marceloviannadev
    @marceloviannadev ปีที่แล้ว +8

    Use "Headwind" instead. Does the same with less complications. The only problem I've found so far is when u use [ ] custom values. In this case, classes do not sorted out and u have to do manually. Other than that, it's amazing! 🤘

    • @hooooman.
      @hooooman. 2 หลายเดือนก่อน +1

      "custom-values []" also working fine now, tried and confirmed it and loving it. anyway thanks for the suggestion, as the plugin mentioned in this video not worked for me lol

  • @leon_the_professional
    @leon_the_professional หลายเดือนก่อน

    Modern solutions require modern problems

  • @eddybowie2211
    @eddybowie2211 ปีที่แล้ว +4

    THIS IS A LIFESAVER! Sometimes I have 2+ lines of just tailwind styles and it's a pain in the arse having to go trough it all looking for a simple p-3 💀, specially when applying different styles for different screen sizes

  • @codingman8056
    @codingman8056 6 หลายเดือนก่อน

    Thanks for the package, Kyle

  • @xDmtm
    @xDmtm 2 หลายเดือนก่อน

    Yeeeesss! I was just thinking about whether there is an extension that reorders classes.

  • @javhaasuhochir8126
    @javhaasuhochir8126 10 หลายเดือนก่อน +8

    that library is not working in my vscode. But I downloaded extenstion called "headwind" and it worked.

  • @njokuchisomjoseph
    @njokuchisomjoseph 2 หลายเดือนก่อน +1

    Since it would it is a dev dependecy and would probably only be used locally on your pc, i think installing it globally would be great instead of installing it as a dev-dependecy on every project

  • @eliasvonbrille
    @eliasvonbrille ปีที่แล้ว

    Is it just me or does this guy look like handsome real life gigachad

  • @lovedayevans5406
    @lovedayevans5406 ปีที่แล้ว

    I really appreciate this... This will really help me to improve

  • @ZUNAEED_IMRAN
    @ZUNAEED_IMRAN 4 หลายเดือนก่อน

    thanks man.

  • @GeneraluStelaru
    @GeneraluStelaru 4 หลายเดือนก่อน +1

    I can't understand how this is better than bootstrap. Not that I like the latter either.

    • @OpeyemiFatogun
      @OpeyemiFatogun 2 หลายเดือนก่อน

      Has more range than Bootstrap

  • @bharadwajvaranasi6447
    @bharadwajvaranasi6447 ปีที่แล้ว

    Super. Soo helpful. Thank you so much

  • @breezycodes
    @breezycodes ปีที่แล้ว +3

    Good plugin but it makes saving a file a pain in big projects. I had to stop using it in big projects as it would cause vscode to freeze for like 5 mins while trying to save a file.

  • @tauraigombera
    @tauraigombera ปีที่แล้ว

    Thank you

  • @nickwoodward819
    @nickwoodward819 ปีที่แล้ว

    bigger prob for me is that astro seems to hate multi-line classes, even in template strings. I'd like to be able to have them structured by attribute, so `row-start-4 md:row-start-6 lg:row-start-2` and then cols on a new line.

  • @incarnateTheGreat
    @incarnateTheGreat 9 หลายเดือนก่อน

    There are a few like this. I use one for eslint and it works very well.

  • @ZackOfAllTrad3s
    @ZackOfAllTrad3s 9 หลายเดือนก่อน

    I too, like many people, got caught in this time sink. Just too many issues with getting it to work.

  • @glibaudio
    @glibaudio ปีที่แล้ว

    Super helpful ty

  • @saiphaneeshk.h.5482
    @saiphaneeshk.h.5482 10 หลายเดือนก่อน

    I've been using this method for normal css.

  • @FireGames25
    @FireGames25 ปีที่แล้ว +53

    I just use an extension that does that (headwind)

    • @AhmadMughal1
      @AhmadMughal1 ปีที่แล้ว +6

      thanks for the recommendation much better than messing up prettier as it causes alot of different conflicts

    • @rahul_bali
      @rahul_bali ปีที่แล้ว +2

      thanks

    • @dragononfire7124
      @dragononfire7124 ปีที่แล้ว +2

      Thanks bro, it is really helpful 😍

    • @FONO63
      @FONO63 ปีที่แล้ว +4

      Lifesaver, this comment. Prettier Tailwindcss plugin has all sort of problems.

    • @redsharingan6190
      @redsharingan6190 11 หลายเดือนก่อน +5

      give this man a nobel price

  • @alexweej
    @alexweej 10 หลายเดือนก่อน +2

    As someone who learned CSS when it was new in the 90s... What the **** is this Tailwind noise?

    • @aryansoni57
      @aryansoni57 หลายเดือนก่อน

      Tailwind is a more efficient way to write css

  • @chiragchhajed8353
    @chiragchhajed8353 ปีที่แล้ว +2

    There's an vscode extension to right, HeadWind CSS

  • @heracraft5526
    @heracraft5526 ปีที่แล้ว

    Theo said the same thing ☺️

  • @bonekazz-8441
    @bonekazz-8441 5 หลายเดือนก่อน

    I do that without noticing it hahah just be organized

  • @wandenreich770
    @wandenreich770 ปีที่แล้ว

    as always great content

  • @theanarchist4449
    @theanarchist4449 ปีที่แล้ว

    That's why I prefer writing pure css in classes and add class to html. How convenient? And readable too.

    • @PsychoDude
      @PsychoDude 11 หลายเดือนก่อน

      how convenient naming everything hahaha

  • @Srabon444
    @Srabon444 4 หลายเดือนก่อน +1

    How can I use it in the NextJS project in Webstorm IDE? Does anyone know how? I tried installing and saving the file, but unfortunately, it doesn't do anything.

  • @markusklyver6277
    @markusklyver6277 4 หลายเดือนก่อน +1

    neovim tho

  • @kevinka99
    @kevinka99 11 หลายเดือนก่อน

    Well, you forgot to mention that to it work as you said you need to have Prettier extension installed in your editor and set it as default and if it's VSCode you must need to turn on the formatOnSave options on settings.json.

    • @Vikings-uk3ht
      @Vikings-uk3ht 9 หลายเดือนก่อน

      thank you for this

  • @matteonegridev
    @matteonegridev 14 วันที่ผ่านมา

    Guys how to properly install it? It doesn’t work for me…

  • @linxzzsr
    @linxzzsr ปีที่แล้ว +1

    Insane

  • @hamaomer1825
    @hamaomer1825 6 หลายเดือนก่อน

    why i cant find that plug in :(

  • @mikec9444
    @mikec9444 ปีที่แล้ว

    preach!

  • @blackpurple9163
    @blackpurple9163 ปีที่แล้ว +3

    Isn't there a vs code extension for this already???

    • @Jacob-ch8qj
      @Jacob-ch8qj ปีที่แล้ว +5

      I use headwind for this yeah

    • @ZiPMo85
      @ZiPMo85 ปีที่แล้ว

      ​@@Jacob-ch8qj yeah same. Unnecessary dev dependency

    • @imkir4n
      @imkir4n ปีที่แล้ว

      @@ZiPMo85 yeah makes sense

    • @airixxxx
      @airixxxx ปีที่แล้ว +1

      @@ZiPMo85 You need to tell all the people on the project and every time someone new comes to use vs code and to install the extension. That's the need of the dependency.

  • @AlThePal78
    @AlThePal78 3 หลายเดือนก่อน

    So you prefer tw over bootstrap

  • @GeorgeNey
    @GeorgeNey 3 หลายเดือนก่อน

    Copy paste installation:
    npm i -D prettier-plugin-tailwindcss

  • @RS4P
    @RS4P 8 หลายเดือนก่อน

    Isn’t it better to do “py-3 px-2”, rather than “p-3 px-2”?

  • @syed.simanta820
    @syed.simanta820 10 หลายเดือนก่อน

    Life saver 🎉

  • @hooooman.
    @hooooman. 2 หลายเดือนก่อน

    didnt worked for me, added the " .prettierrc" file in the root directory as per the official documentation of tailwind.css, restarted the vs code, still the code formating didnt worked. meanwhile form this comment section, saw about "Headwind" vscode extension, tried it, it worked absolutely perfect,even for custom tailwind class

  • @sD-fc9mp
    @sD-fc9mp 3 หลายเดือนก่อน

    🙏🏾 🙏🏾 🙏🏾

  • @anshulanand02
    @anshulanand02 ปีที่แล้ว

    That's really nice 👍

  • @abdalrhmanalmarakeby5813
    @abdalrhmanalmarakeby5813 ปีที่แล้ว

    Why it is not working in my project , HELP please!!!

  • @redmizu
    @redmizu 4 หลายเดือนก่อน

    isn't that the same as the headwind extension?

  • @dvirhanum9530
    @dvirhanum9530 ปีที่แล้ว

    How can I break each class on a new line?

  • @tito_me_doe676
    @tito_me_doe676 หลายเดือนก่อน +2

    I’m a developer for over 20 years, and frameworks like tailwind where you design with classes goes against every best practice rule that was ever taught to me. It forces the user to put the design into the markup, rather than separating concerns. In addition, you end up with dozens of KB or so of CSS that will never be used. Just my $0.02

    • @Xtreme-yb9yo
      @Xtreme-yb9yo หลายเดือนก่อน +3

      you do know that unused css can get purged before production right

  • @keyboardmandaniel
    @keyboardmandaniel 7 หลายเดือนก่อน

    What is the name of this plugin?

  • @rajeshbudhathoki7888
    @rajeshbudhathoki7888 11 หลายเดือนก่อน

    It is no longer working with prettier extension. Anyone having the same problem?

  • @tusharkashyap3241
    @tusharkashyap3241 ปีที่แล้ว +1

    i don't know why but this does not work for me for some reasons I'm nextjs's app directory with eslint and this plugin does not work for me. any suggestions?

    • @sck3570
      @sck3570 ปีที่แล้ว

      for me too, it doesnt format at all, prettier formats the html or js text but not the tailwind part

  • @contraspower6302
    @contraspower6302 2 หลายเดือนก่อน

    Sick🔥

  • @okosunfamily1081
    @okosunfamily1081 ปีที่แล้ว

    Tailwind I'm still learning you but I have a filling you would be the best

  • @tomfarrell4651
    @tomfarrell4651 9 หลายเดือนก่อน +3

    I’m not a fan of adding 56 classes to a div.

  • @over1498
    @over1498 ปีที่แล้ว

    This is a game changer, how does it work with clsx though, I feel like it could screw something up

  • @swapnilraj4989
    @swapnilraj4989 ปีที่แล้ว

    Is there a similar extension on vs code for CSS. Like when format document it arranges the css styles in either alphabetical way or logical way

  • @skyzane2735
    @skyzane2735 ปีที่แล้ว

    can I install it globally instead? Or configure my prettier vscode extension with it?

  • @ricardocnn
    @ricardocnn ปีที่แล้ว

    Awesome 👍

  • @linxzzsr
    @linxzzsr ปีที่แล้ว +1

    Bootstrap vs Tailwind recommend anyone ? How can I use Bootstrap without CDN also in my react app without react bootstrap which is really complicated??

    • @Surya-np1bb
      @Surya-np1bb ปีที่แล้ว +2

      Tailwind Anyday

    • @KILLCHRISU
      @KILLCHRISU ปีที่แล้ว +2

      forget bootstrap just learn tailwind

  • @PremShankarTiwari-f8c
    @PremShankarTiwari-f8c ปีที่แล้ว

    will it work with cva library also?

  • @samirhajdarevic7757
    @samirhajdarevic7757 หลายเดือนก่อน

    Don't use too many plugins

  • @blenderpanzi
    @blenderpanzi 11 หลายเดือนก่อน

    I still don't understand tailwind. If you have one class for each style property+value, why not just use the style="..." attribute? It is what you're effectively doing.

  • @onecarwood
    @onecarwood ปีที่แล้ว

    What happened to Bootstrap? It changed its name to Tailwind.

    • @GamerSharp
      @GamerSharp ปีที่แล้ว

      Bootstrap sucks tbh

    • @airixxxx
      @airixxxx ปีที่แล้ว

      Bootstrap died a long time ago, the day CSS grid came. And Tailwind has nothing in common with Bootstrap.

  • @re.liable
    @re.liable ปีที่แล้ว

    Does this work with React components as well? Can it only format classes directly assigned to className? What if the classes are stored in a separate string?

    • @maendassin195
      @maendassin195 ปีที่แล้ว

      I'm using tailwind in my current react project and it works great. It sorts classes assigned to the "className" property for react components just fine. I'm not sure what you mean in the last question. Classes stored as a string in a different variable? If so,. I'm not sure as I haven't tried doing that. But if you're doing it to reuse classes for common components then there's a better and more semantic way to do that in the tailwind config file.

    • @falcon4359
      @falcon4359 ปีที่แล้ว

      I don't think it will work if you're assigning a variable or a const. But storing classes in a separate string and this plugin achieves the same thing minimising visual clutter so not sure why you would need both

  • @ademolaadepoju4121
    @ademolaadepoju4121 ปีที่แล้ว

    Does this install globally?

  • @seclvded
    @seclvded ปีที่แล้ว

    just use tailwind styled components to get rid of that long ass class names

  • @izzulhaqmahardika8892
    @izzulhaqmahardika8892 ปีที่แล้ว

    Can i use it while on tailwind cdn?

  • @alekseychikin
    @alekseychikin ปีที่แล้ว +1

    And it is still a mess

  • @AbZen7
    @AbZen7 ปีที่แล้ว

    U bought a second guitar but still never played us something

  • @cau8777
    @cau8777 ปีที่แล้ว

    Do not use this plugin if you use daisy-ui or any other tailwind extensions alike

  • @paschalokafor9043
    @paschalokafor9043 4 หลายเดือนก่อน

    WOW

  • @hnni5149
    @hnni5149 ปีที่แล้ว

    You are nice :)

  • @user-888azim-97
    @user-888azim-97 ปีที่แล้ว

    🌝

  • @mustafasaseldin9457
    @mustafasaseldin9457 9 หลายเดือนก่อน

    🎉❤ Wow

  • @Jody-nf2bz
    @Jody-nf2bz ปีที่แล้ว

    He only said a few words and his head is all over the place! Just calm down! A simple back rest might stabilize your neck!

  • @LarsRyeJeppesen
    @LarsRyeJeppesen ปีที่แล้ว

    @apply

  • @Chris-jm2gx
    @Chris-jm2gx ปีที่แล้ว +1

    ughh, still horrible.

  • @johndominictorcelino
    @johndominictorcelino 4 หลายเดือนก่อน +1

    npm i -D prettier-plugin-tailwindcss

  • @lwd3035
    @lwd3035 ปีที่แล้ว

    Not prettier than you 😉

  • @iwankiddies9274
    @iwankiddies9274 ปีที่แล้ว

    How you add background image with tailwind in react

  • @Edwinil
    @Edwinil ปีที่แล้ว

    npm i -D prettier-plugin-tailwindcss
    // prettier.config.js
    module.exports = {
    plugins: [require('prettier-plugin-tailwindcss')],
    }

  • @hetsahk
    @hetsahk ปีที่แล้ว +2

    Tailwind is shit man, idk why ppl are so hyped about

    • @wildanm2
      @wildanm2 ปีที่แล้ว

      why tailwind is shit?

    • @hetsahk
      @hetsahk ปีที่แล้ว +1

      @@wildanm2 because it doesn't solve any problems, the real problem is that no one wants to learn CSS properly. We have web components and CSS custom properties, you don't need Tailwind at all, it's just the Bootstrap of the Z generation.

  • @keyboardmandaniel
    @keyboardmandaniel 7 หลายเดือนก่อน

    What is the name of this plugin?

  • @AindriuMacGiollaEoin
    @AindriuMacGiollaEoin ปีที่แล้ว

    npm i -D prettier-plugin-tailwindcss

  • @kimbapslayer1995
    @kimbapslayer1995 ปีที่แล้ว +11

    Every time you hit the save button, it all flip flops, then you realize you made a mistake although you haven’t moved your cursor yet, and end up editing the wrong class cos it switched positions. So you gotta undo a few times. My biggest problem with it.

    • @andreandersson1137
      @andreandersson1137 ปีที่แล้ว +3

      Run it in a pre-commit hook instead, and thats solved. Then its also going to work in all editors, Notepad and Word included 😅

    • @rickybeats1919
      @rickybeats1919 8 หลายเดือนก่อน

      Yep this is my issue too, i removed the plugin

    • @BlenderfulShowcases
      @BlenderfulShowcases 7 หลายเดือนก่อน

      Sounds like a skill issue xd

  • @ssygon2
    @ssygon2 ปีที่แล้ว +3

    TW=Classes hell. Just have reusable SCSS/LESS mixins functions, which can just use 1 or a few classes.

    • @mooza.shorts
      @mooza.shorts ปีที่แล้ว

      Do you think that on a comparison between two versions of a big, heavily css decorated page, the first with tailwindcss, the other with a wisely optimized SCSS (mixins and stuff) one, would be there a significant reduce of workload on the browser behalf? My opinion (but I'm open to hear different ones) is that given real, enough complex web pages, tailwind results in less stuff to download. I may be wrong, didn't benchmarked yet.

  • @sunilnune5681
    @sunilnune5681 ปีที่แล้ว +7

    Waiting for Next Js to get full support of MUI & Chakra UI

    • @askeladden450
      @askeladden450 ปีที่แล้ว

      What do you mean by full support? Dont they work perfectly as is?

    • @lamhung4899
      @lamhung4899 ปีที่แล้ว

      @@askeladden450 MUI only work on client mode , no server component afaik.

  • @elson_correia
    @elson_correia 5 หลายเดือนก่อน

    That did not improve anything 😕

  • @Sean-mv5kd
    @Sean-mv5kd ปีที่แล้ว +1

    Theo from McDonalds

  • @entertainmentweekly1307
    @entertainmentweekly1307 10 หลายเดือนก่อน

  • @stosyst
    @stosyst ปีที่แล้ว +7

    Taiwin always feels like an inline css on steroids, I always prefered separate css with html - much cleaner and maintainable

  • @epotnwarlock
    @epotnwarlock ปีที่แล้ว +11

    would be nice to have a visualization that shows conflicts in the class or property inheritance or situations where one property is overridden by another

    • @ghazankhan8447
      @ghazankhan8447 ปีที่แล้ว +7

      The liner for tailwind works underlines overlapping classes. Its in vscode

    • @hrvojemarjanovic9188
      @hrvojemarjanovic9188 ปีที่แล้ว +1

      Yes by default it is zig-zag orangish underline

  • @ichiroutakashima4503
    @ichiroutakashima4503 ปีที่แล้ว

    It's hilarious. Makes a post like this then suddenly makes a post that says, don't use tailwind, use CSS.

  • @Oswee
    @Oswee ปีที่แล้ว

    I feel sick of hearing that word...

  • @zuong
    @zuong 9 หลายเดือนก่อน

    Is there a similar way for pure CSS?

  • @theisoj
    @theisoj ปีที่แล้ว +3

    That's crazy! Thanks Kyle as always 👍

  • @MobiusCoin
    @MobiusCoin ปีที่แล้ว

    I think Tailwind is unusable without Prettier.

  • @user-bc7bl1bw6y
    @user-bc7bl1bw6y ปีที่แล้ว

    Yeah easy for me but sometimes use bootstrap so this library also work in bootstrap

  • @juanxc7
    @juanxc7 10 หลายเดือนก่อน

    what if auto save

  • @T1Oracle
    @T1Oracle 10 หลายเดือนก่อน

    SCSS mixins > tailwind