05: Composing Utilities with @apply - Tailwind CSS v2.0: From Zero to Production

  Рет қаралды 58,341

Tailwind Labs

Tailwind Labs

Күн бұрын

Пікірлер: 81
@Jugement
@Jugement 3 жыл бұрын
Dude, this is so sick !!! When i first heard about Tailwind, i was kinda skeptical about the class stacking which would result from a functionality oriented framework, but this removes nearly every issue regarding this topic !! Mad respects, i'm genuinely super hyped to start using Tailwind
@zihadhosan23
@zihadhosan23 3 жыл бұрын
while you talk, I can see you're smiling very lightly. smile of haven. I really like how you're teaching us with pleasure. I appreciate how you describe everything as like easy as bite a cake. Thank you!! I'm switching BootStrap to Tailwain. :D
@tmstechsup3992
@tmstechsup3992 3 жыл бұрын
Are you from Bangladesh?
@zihadhosan23
@zihadhosan23 3 жыл бұрын
@@tmstechsup3992 Yes 🇧🇩🇧🇩
@tmstechsup3992
@tmstechsup3992 3 жыл бұрын
@@zihadhosan23 amgo deshe vai maximum manush bootstrap,php,angular chara ar kisui chine na 🙂 egular baireo j aro koto kisu ase,KZbin na ghatle jantam i na
@abdullahkhalidomi3808
@abdullahkhalidomi3808 3 жыл бұрын
​@@tmstechsup3992 jane vai jane. but tutorial banay na ei ki
@TheXuism
@TheXuism 2 жыл бұрын
Tailwind makes Boostrap like a trap.
@lukasluftlaufer1093
@lukasluftlaufer1093 3 жыл бұрын
Watching from video 1 I was like "meh, why learn a new thing, when I have scss?", but slowly I am getting a fan of tailwind, also thanks to these beautiful tutorials here. Thanks as lot :)
@JoanSubiratsLlaveria
@JoanSubiratsLlaveria 3 жыл бұрын
Man, TailwindCSS it's amazing, but this guy speak very clear. Thank you!!!
@ed1nh0
@ed1nh0 3 жыл бұрын
As a frontend developer I've been working with CSS since earlier 2000's. Day by day Tailwind continues to surprise me with all its features!
@dr.slowdeath1852
@dr.slowdeath1852 23 күн бұрын
Stumbled upon your video while looking for an explanation whwn and when not to use @apply. But found the @layer components feature haha thank you 🎉
@J90JAM
@J90JAM 3 жыл бұрын
This is where having experience of modular CSS comes in handy 🙌
@MohamIsMe
@MohamIsMe Күн бұрын
Congrats. You created Bootstrap in Tailwind.
@goncalodumas
@goncalodumas 3 жыл бұрын
This card is familiar! Thanks for condensing Adam's (also great, but old..er) videos!
@23pointblank
@23pointblank 3 жыл бұрын
Very cool. I am definitely switching from bootstrap to this.
@hey_ashy
@hey_ashy 3 жыл бұрын
Same. I switched from Bootstrap to Tailwind for my project I started a few days ago. I personally feel it's so much better as it has more granular control over the ui.
@yestermonth
@yestermonth 3 жыл бұрын
@@hey_ashy how's it going?
@AnatolyKosorukov
@AnatolyKosorukov 3 жыл бұрын
I think all Tailwind business components related to @apply idea. This one helps develops all of that.
@franki8469
@franki8469 3 жыл бұрын
1:25 how do look on this css file generated from my tailwind classes?
@smritinayak1171
@smritinayak1171 3 жыл бұрын
have you got the solution?
@adisakjantrasopark7672
@adisakjantrasopark7672 3 жыл бұрын
Thank you for these clips but I need help to fix this " @layer " [vite] Internal server error: Expected a pseudo-class or pseudo-element. and " Unknown at rule @tailwind css (unknownAtRules) [1, 2, 3,]"
@onthecodeagain
@onthecodeagain 3 жыл бұрын
I had the same issue, it was the formatter putting a space in the tailwind.css file so for example sm:text-base became sm: text-base
@mostafahosseini2762
@mostafahosseini2762 2 ай бұрын
Thanks to Sharing your Knowledge , That's Great !
@craigburton4447
@craigburton4447 3 жыл бұрын
How did you look at the generated css?
@Psyzenn
@Psyzenn Жыл бұрын
The easiest fix in the universe. When you hover over btn or btn-primary to show pop-up with the info tho that require some extension to check your tailwind and display.
@vasiovasio
@vasiovasio 2 жыл бұрын
Great video, but one suggestion - You can use CSS Nano to abstract, combine and optimize all things together, and no need to do it manually.
@JoseGarcia-vr8mx
@JoseGarcia-vr8mx 3 жыл бұрын
This is brilliant! Thank you so much for the tutorial!
@GharKiKheti
@GharKiKheti 3 жыл бұрын
Is it recommended to use @layer component @apply directive with JIT? Can we use it without making code duplication?
@iamthekingofchoco
@iamthekingofchoco 2 жыл бұрын
first, I select the text using multicursor. Then, use CMD+X to cut. But when I paste it back to the btn class, it pastes the text twice..! It is supposed to paste only once?
@DjokovicIsOurLordAndSaviour
@DjokovicIsOurLordAndSaviour 3 жыл бұрын
Adding the class to the @tailwind components section or as a layer is having no effect for me. Anyone have any ideas?
@arponkapuria3330
@arponkapuria3330 2 жыл бұрын
try running the dev command if you installed using npm.
@beqashekiladze8937
@beqashekiladze8937 Жыл бұрын
How did you generate the 'tailwind.css demo' content? It looked like regular css.
@jarednthomas
@jarednthomas 2 жыл бұрын
Great video, thank you! 😊❤️
@EnterOsaka
@EnterOsaka 2 жыл бұрын
You're copying and pasting and moving code like a pro in VSC, how do you do it. I have no idea and am not a power user yet :) I have really enjoyed following along with these videos!
@markryandelarmente8349
@markryandelarmente8349 3 жыл бұрын
Wow, awesome man. Thanks for this video
@treyrader
@treyrader 9 ай бұрын
that's one way to do it! cool tutorial. I guess if you were writing in react, you'd just make a button component and dump all the classes in there, yea?
@Raj-jz4fc
@Raj-jz4fc 3 жыл бұрын
Explanation is awesome
@pradeepb
@pradeepb 3 жыл бұрын
[plugin:vite:css] C:/Users/HP/Desktop/tailwind/css/tailwind.css?direct:18:205: The `active:bg-indigo-600` class does not exist, but `hover:bg-indigo-600` does. If you're sure that `active:bg-indigo-600` exists, make sure that any `@import` statements are being properly processed before Tailwind CSS sees your CSS, as `@apply` can only be used for classes in the same CSS tree.
@anandanss
@anandanss 2 жыл бұрын
Very helpful tutorial, thank you 👍
@abhilashoommen4704
@abhilashoommen4704 3 жыл бұрын
which ide are you using, want that preview
@rickdev1922
@rickdev1922 3 жыл бұрын
it's a sizzy browser
@JewelIslam-d4o
@JewelIslam-d4o Жыл бұрын
Which editor you are using/
@Ryu-vg8td
@Ryu-vg8td 3 жыл бұрын
Hello j'ai remarqué ton accent francais, j'ai un petit soucis avec @apply il ne récupère pas mes nouvelles classes vous avez une idée pour cela fonctionne je trouve aucun élément de réponse
@zorro1rr
@zorro1rr 3 жыл бұрын
Why did he put the shadow-lg hover:-translate-y-0.5 transform inline in the html instead of in the tailwind.css btn-primary apply? Just to show how both ways are done? In my mind if we are going to decide to using the apply feature it might be best to put all of the unique styles there. Thanks for the videos!
@vasiovasio
@vasiovasio 3 жыл бұрын
Yes, I ask myself the same...
@khalidahmada3906
@khalidahmada3906 3 жыл бұрын
Thank you ! so powerful
@alanballard8740
@alanballard8740 3 жыл бұрын
How do you get that font for "class" in your editor?
@SebastianPerezG
@SebastianPerezG 2 жыл бұрын
i can't make that work, i did the same and its not working , i need some extra plugin for that ?
@arponkapuria3330
@arponkapuria3330 2 жыл бұрын
it worked for me when ran the dev command
@willianarcaya
@willianarcaya 3 жыл бұрын
Great tool!! but I have issues moving btn classes to @apply or @layer. Console says [vite] Internal server error: Expected a pseudo-class or pseudo-element. Plugin: vite:css
@omurchu
@omurchu 3 жыл бұрын
Hey, have you solved this ? I am getting The `active:bg-gray-400` class does not exist, only on the active class
@willianarcaya
@willianarcaya 3 жыл бұрын
​@@omurchu Hi There! I did some tests and found that some classes are generating errors after moving it to the tailwind.css file. After removed those classes the code works fine. Also, I've tried on another projects with different classes and everything goes well. Removing class by class on my code with errors I found that hover could be the cause of my error. Using just inline Tailwind styles everything run smoothly
@willianarcaya
@willianarcaya 3 жыл бұрын
Edit: After trying with a few different methods I always got the same result. Error: Expected a pseudo-class or pseudo-element. on @apply I Cant use pseudo elements such as Hover. :(
@BrianDanchilla
@BrianDanchilla 3 жыл бұрын
For me it was breaking until I noticed I had a space after a pseudo element. eg hover: bg-indigo-500 to hover:bg-indigo-500 fixed the issue
@aj4819
@aj4819 3 жыл бұрын
@@willianarcaya I just looked at the source code in github from the link below the video and grabbed all the classes from there, copied them into my css file and it worked. I must have typed something incorrectly somewhere. EDIT: Actually that didn't do it, but going into VS Code settings and unticking css:validate seemed to do the trick!
@mattari97
@mattari97 2 жыл бұрын
This is awesome. The only annoyance is that its not working w/ intellisense.
@mofifunoluwake
@mofifunoluwake 2 жыл бұрын
it's not??? Maybe that is why mine isnt working
@mattari97
@mattari97 2 жыл бұрын
@@mofifunoluwake no unfortunatly. If you want intellisense you should create it in the tailwind.config plugins
@marekkarasz3776
@marekkarasz3776 2 жыл бұрын
why this does not work with my version 3.2 ?
@arponkapuria3330
@arponkapuria3330 2 жыл бұрын
it worked for me when i ran the dev command
@苑畅
@苑畅 3 жыл бұрын
非常棒的教程
@xames7789
@xames7789 3 жыл бұрын
Doesnt work classes in my codes. Idnk why? Can anyone help me or anyone have problem like that?
@xames7789
@xames7789 3 жыл бұрын
Or should i dowload some extension?
@Rajroyal384
@Rajroyal384 3 ай бұрын
thank you so much for this
@samduss4193
@samduss4193 11 ай бұрын
there is a french or german accent in the background right i guess french am I right ? lol
@MrMazvaz
@MrMazvaz Жыл бұрын
@layer is not a tailwind directive. Its css
@TailwindLabs
@TailwindLabs Жыл бұрын
We actually added `@layer` as a preprocessor function before it was a thing in CSS, so it behaves differently in Tailwind than natively. There are no `@layer` rules in the final output.
@ignaciomatiasdiaz9710
@ignaciomatiasdiaz9710 11 ай бұрын
Excelente.
@weizhixie9678
@weizhixie9678 3 жыл бұрын
I am not afraid of CSS anymore. Thanks, Tailwind team.
@lucasdallier1023
@lucasdallier1023 2 жыл бұрын
good!!
@Ch051
@Ch051 Жыл бұрын
tailwind: semantic css is bad also tailwind: @apply
@aram5642
@aram5642 3 жыл бұрын
Yuck
@devKazuto
@devKazuto 3 жыл бұрын
It's just ugly having dozens and dozens of classes in HTML and violates "Separation of concerns". CSS is where the style resides, not HTML. Otherwise, you could just as well write inline styles directly in HTML. Usually, you have a style guide for projects anyway, so there shouldn't be a need to know what a class applies but only which classes to use.
@TheRafark
@TheRafark 3 жыл бұрын
The styles are still in a separate CSS file... I found the code actually beautiful. In the last lesson, when he added position absolute to the image but had to add position relative to the parent div, it was extremely readable. You could see the word relative in one line and then the word absolute right in the next line. This relationship in a CSS file is a nightmare (making sure the parent has a relative position when needed. You seem to be very closed minded.
@devKazuto
@devKazuto 3 жыл бұрын
@@TheRafark I'm far from closed-minded. But I use languages and tools as they're intended to and not how I want them to function. That's why I dislike the JSX. HTML in PHP has been taboo, "smelly code" or bad practice for a long time and that's why Blade and Twig came to life, yet writing HTML in JS seems to be acceptable, even though it's no different from HTML in PHP. No, it's not acceptable. It's ugly and is completely against "Separation of concerns". Now add "utility-first" styling to it. It becomes a complete and utter mess. Hard to read and even harder to maintain. It's fairly simple: HTML is for layout, CSS is for style and JS for functionality. You don't merge these into one large blob. "making sure the parent has a relative position when needed" that's part of the job. If that's a problem for you, you seem to be very lazy, to use your own words.
@Tobias-
@Tobias- 2 жыл бұрын
@@devKazuto I think there's an audience for everything. This clearly is not for you. I'm trying to figure out if I like this. At the moment I see having this apply function as a fix for a non existing problem. When just writing in css in the first place I mean ;-) We're back at square one.
@themodernmonk7
@themodernmonk7 2 жыл бұрын
Why is it not working in my version 3.1.8???
@arponkapuria3330
@arponkapuria3330 2 жыл бұрын
did you solve the issue ?
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Binary Search Pattern Identification | DSA Practice
18:04
Shrayansh Jain
Рет қаралды 23
I WISH I Knew These Tailwind Tips Earlier
9:15
Theo - t3․gg
Рет қаралды 201 М.
10 Tailwind Classes I Wish I Knew Earlier
13:31
Web Dev Simplified
Рет қаралды 201 М.
Stop using an extension to compile Sass
21:39
Kevin Powell
Рет қаралды 131 М.
03: Responsive Design - Tailwind CSS v2.0: From Zero to Production
18:45
How the PROS Use Tailwind
9:55
Frontend FYI – by Jeroen
Рет қаралды 58 М.
Tru Narla: Building a design system in Next.js with Tailwind
13:35
Styling Forms with Tailwind CSS
17:25
Tailwind Labs
Рет қаралды 143 М.
10 CSS Pro Tips - Code this, NOT that!
9:39
Fireship
Рет қаралды 2,2 МЛН