The same trick can be used to manage Light/Dark mode toggle which makes life so much easier
@WaqarAhmad-jp4mw3 жыл бұрын
Can you please explain a bit how we can achieve tht
@ed1nh03 жыл бұрын
And that's the beauty of CSS! You always learn something new every time you watch videos like yours. That isolation property is something I'd study a bit further because it should solve an issue I've had in the past. Custom properties is really misused even nowadays and they definitely can solve a loooot of headaches regarding mods, variants and even specificity. Thanks Kevin! You nailed it again! 👍🏼👍🏼👍🏼
@toddribnek66603 жыл бұрын
Good stuff. Two things that you went really quickly over and might need further explanation. Inset defined the top, right, bottom, left properties. Transform scale(0,0) makes the background disappear until the :hover transform scale (1,1) made it visible.
@KevinPowell3 жыл бұрын
Yes, good point, I did skip over that pretty fast!
@ed1nh03 жыл бұрын
He already spoke about the inset property before.
@Neth913 жыл бұрын
i just want to put this into all my css and rework my whole project. its so cool
@clevermissfox11 ай бұрын
These locally scoped properties have really cleaned up my css!
@dave60123 жыл бұрын
I wish there was a backend youtube creator who is as good a teacher as Kevin here. I’d be #fullstack in no time!
@valentepablo2 жыл бұрын
There's Kyle from WebDevSimplified, he's amazing. But if you talk about going deep into things like Kevin, there's one I know but he's mexican, his courses and tutorials are in spanish :c. Anyways, in case you speak spanish, check JonMirCha's channel!
@dave60122 жыл бұрын
@@valentepablo Kyle isn’t backend. He’s touched on node.js a bit but he’s 90% front-end javascript.
@ViorelMocanu3 жыл бұрын
Great, time-saving and complexity-reducing technique, Kevin! Great job, as always!
@jsuddsjr3 жыл бұрын
I need to use CSS vars more. Thanks for the tips!
@gregoryolenovich64403 жыл бұрын
Hey Kevin, something really useful you didn't mention (and I find no one really talks about this) is that you can also define custom properties via the html style="--btn-clr: blue;" on an element. This can be super useful in certain instances, like using props in react and lots of other uses.
@KevinPowell3 жыл бұрын
Yes, for sure! I'll try to remember to mention it in a video at one point, because that is a great use case 😊
@Brunoenribeiro3 жыл бұрын
0:47 kevin is almost rapping the intro by now 😜 10 words per second
@developerfilip3 жыл бұрын
At the rate at which CSS is expanding, I will soon allow myself to call it a programming language :D
@sarahwbs2 жыл бұрын
Awesome video, so many great little tidbits included 👏
@ThomKnepper3 жыл бұрын
This is so fun! I'll definitely be rewriting a whole bunch of css.
@FaizanAnwerAli3 жыл бұрын
Can you explain on details about difference between gird area and grid line names not line numbers. And also their usability using single line gird-template: property.
@kieransweeden3 жыл бұрын
Loved this! Thank you for such an informative & fun video.
@rickardelimaa3 жыл бұрын
It's also easier to just play around with things in the Inspector when you got CSS properties set that affects several elements, let say the animation speed, as mentioned in the video.
@mrSargi73 жыл бұрын
Gonna refactor my css tomorrow after watching this
@shrishailgharat19643 жыл бұрын
Really appreciate this 😭
@FuzailShaikh3 жыл бұрын
I remember the days when CSS used to be so simple, it changed so quickly over the years
@eliseenlaura3 жыл бұрын
Hey Kevin, what do you do about IE11 not supporting css variables? Do you make a fallback for all of them or just simple: ignore IE11?
@AdamFiregate3 жыл бұрын
Great example, thank you!
@YaroLord3 жыл бұрын
Hi Kevin, by any chance will there be any more SASS tutorials in the future? I believe stuff like this would be taken advantage of in scss and I barely see any tutorials for it.
@chanduallada24173 жыл бұрын
Such a fantastic explanation 👏👌
@und03 жыл бұрын
Hey Kevin, great video but perhaps you should call "custom properties" "css variables" instead? "custom properties" is a correct term however I think most people know simply as "css variables". Keep it up!
@majklzumberi17613 жыл бұрын
Ot question, how do i handle the 100vh in mobile browsers that have the "chin" (search bar, URL)?
@HeyNoah3 жыл бұрын
This is awesome!
@techwake3603 жыл бұрын
that was awesome, Thank you so much
@ShaunLevett3 жыл бұрын
Just a note. Isolation:isolate did some really buggy stuff in Safari when I used it. Had to remove it. Was causing bizarre layout issues on the page.
@KevinPowell3 жыл бұрын
Oh, good to know. You can just throw a z-index and position: relative on there instead until they get it sorted out :)
@tcgvsocg14583 жыл бұрын
Yes i am new here and its really cool
@cafe-tomate3 жыл бұрын
Hi Kevin, I've checked the MDN specification webpage and it says IE does not support the var thing.
@cafe-tomate3 жыл бұрын
According to the MDN specification as well, scale or scale3d animations should be avoided (or it should be a way to unable them) for the people suffering from headaches
@muhammadhaziqbinmusa40223 жыл бұрын
hi kevin, i love to your videos. I've learn so much things from there. I've some questions. How can i create a responsive background image. If you dont mind, could make a video about that? Thank you Kevin❤️
@mh_kohansal3 жыл бұрын
very nice trick. thank's man
@raghibhussain13753 жыл бұрын
Coolest CSS tutorial 👍👍👍
@alexrafter3 жыл бұрын
Very nice!
@TwanvB3 жыл бұрын
Came looking for frontend goodies, but found gold!
@wumbl32 жыл бұрын
I've been doing this for months :D
@aprimic3 жыл бұрын
if you're gonna make the scale y and x the same, why not just use one param?
@chimchim2_3 жыл бұрын
I FUCKING love this!
@NathanHedglin3 жыл бұрын
Wow how didn’t I know about this? Love the content Kevin! Sadly we still support IE at work 😭 but for everything else!
@AdamFiregate3 жыл бұрын
Hi Nathan, which project and environment needs still IE?
@dandandan013 жыл бұрын
@@AdamFiregate I still need to support IE - I work in insurance direct to brokers
@INT4RGH3 жыл бұрын
Why does ppl do and not just ?
@MostlySoftware3 жыл бұрын
because isn't a valid html tag. while it is technically possible to do it, and there are some workarounds, it's generally considered bad practice to make up your own tags. It can mess with the way google, browsers, and screen readers see the website.
@PrinjuVaidyan3 жыл бұрын
Thanks Kevin
@martinb.16073 жыл бұрын
is there any point of SCSS then?
@ЯМолодец-ъ6ш3 жыл бұрын
Great lesson) But is there a way to control scope for nested blocks? I mean how to unset a var value back to default for inner elements? I tried this trick to make custom columns system. Sometimes I have complicated grig and I need to put columns into column. And if I changed a var for outer column (to not default), i need override this value for inner columns. But it means that default value will never used.
@KevinPowell3 жыл бұрын
You could have a 'default-cols' class or something for now. They are working on scope for CSS, which would do exactly what you want, but for now we don't have that option.
@ЯМолодец-ъ6ш3 жыл бұрын
@@KevinPowell Thanks for your answer, I will try) Currently I use next trick: .col-1 > *,.col-2 >*,.col-3 > * {--column: initial;} to reset value. It works fine, but i'm not sure to use cascade is a good idea.
@forrest_lump3 жыл бұрын
Isn't it declaring a variable instead of a custom property? I think that --btn-clr is not a property although it's written at the place where normally a property has to be - property:value;. I'm a bit confused when you name it a custom property. IMO it's declaring a variable in the scope of an element (or selector).
@Anfauglir9993 жыл бұрын
This was very usefull. thx
@twrkhanasparukh3 жыл бұрын
pretty slick
@zachjensz3 жыл бұрын
Go make buttons! Stop reading the comments
@danisob36333 жыл бұрын
don't mind me. just studying youtube reply button and input box
@jamshediqbal79363 жыл бұрын
What does isolation property do?
@siddiqahmed32743 жыл бұрын
Creates a new stacking context so that it's child should never escape the element. I hope it makes sense. If you have used before and after and used negative z-index to push them back, i an sure you had probably ran into an issue that they just disappeared (when you only wanted it to go below content). Isolation isolate won't let then disappear.... I hope i an clear enough or i hope someone else might make it more clear to you
@BrunoMussoi3 жыл бұрын
Kevin, a fun challenge for you. Not hard, just a lot of work I guess. Replicate your video intro in html with css animations
@mahmoudalhussain92913 жыл бұрын
Hi Kevin, thanks for sharing ur knowledge, is there any extension or an way to detect unused CSS in a website, when i make a performance test to my website using google lighthouse i get this message (remove unused css) and i don't know how to detect it any clue ? Thanks in advance
@KevinPowell3 жыл бұрын
There are a bunch of build tools that can do it. I don't know of any extensions, but I also haven't looked. Purge CSS is a popular tool for this, and if you Google removing unused CSS you'll find others too :)
@mahmoudalhussain92913 жыл бұрын
@@KevinPowell thank u for ur reply Purge CSS is the tool that i needed.
@leojclarke3 жыл бұрын
I read this as "locally scooped" at least 5 times... lol
@ciungalunga3 жыл бұрын
why use SCSS at all if you use css custom properties ?
@JustPerfectDesigns3 жыл бұрын
Awesome stuff 👍
@varunjathin3 жыл бұрын
Can we use this along with the SCSS $var???
@KevinPowell3 жыл бұрын
You *could* do similar-ish things with SCSS variables, but they aren't quite the same, so you might run into some issues. I haven't tried something like this, but I *think* it would work... You can also use custom properties with SCSS as well 😊
@danisob36333 жыл бұрын
cool! thanks
@alialavizadeh27753 жыл бұрын
cool
@TouchMyTripByAjesh3 жыл бұрын
Nice 👍
@melekRebai3 жыл бұрын
Very nice vIdeo
@ArielBerloto3 жыл бұрын
Awesome!
@KevinPowell3 жыл бұрын
Thanks!
@chezchezchezchez3 жыл бұрын
Does this work on mobile?
@KevinPowell3 жыл бұрын
Sure does 😊. Only issue is if you still need to support IE, but *most* people don't need to worry about that anymore. I realize some do, but for almost all of us, it's really not a concern anymore.
@metallicw26433 жыл бұрын
I LIKE THEN WATCH
@shoaibrehman13483 жыл бұрын
love sir from pakistan....
@S_Singh13033 жыл бұрын
First Like😌
@TerminatorFiles3 жыл бұрын
Could be even shorter, if you actually used the powers of Sass, like nesting. We see you use the scss format, but still write normal CSS. I suspect you do this for the less experienced viewers... but its still somewhat annoying. Maybe do a lesson about that.