Тёмный
No video :(

These CSS features give us more control on the cascade and specificity 

Kevin Powell
Подписаться 936 тыс.
Просмотров 20 тыс.
50% 1

Опубликовано:

 

27 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 35   
@rafa6536
@rafa6536 4 месяца назад
I am using BEM, 10000 lines of code in one file and no problem with maintenance and specificity. Before I started using BEM, CSS was a nightmare for me and I really didn't like it, especially in larger projects, now I like CSS :)
@cintron3d
@cintron3d 4 месяца назад
Wow this is fantastic and deserves more than a ☕. I'll be sharing this with my team as I'm sure it will help a lot of folks level up their css troubleshooting.
@KevinPowell
@KevinPowell 4 месяца назад
Thank you so much!
@alexgochenour8740
@alexgochenour8740 4 месяца назад
Your visceral mastery of this technology is what makes your show so much fun to watch. I especially like your tying in the CSS/HTML to the browser dev tools. Thanks and thanks! 🏮🥐🍰
@petrmotejlek1427
@petrmotejlek1427 День назад
And here I worried this would be a 40ish minute video about using !Important :)
@petrmotejlek1427
@petrmotejlek1427 День назад
Specificity always felt like poker rules. You can kinda reason about them, but in the end, you still gotta learn the order by heart, because they don't all just make sense :D
@castlemoyle
@castlemoyle 4 месяца назад
That trick of hovering over a tag or selector and seeing specificity is great. Doesn't show up in Firefox which is yet another reason for me to quit using it, I guess. Oh and congrats! on your specificity pronunciation!
@vilijanac
@vilijanac 4 месяца назад
What I found useful, embedded CSS in a style tag within the page itself, will override even specificity.
@JasonJA88
@JasonJA88 4 месяца назад
He saved the best for last... Thanks for video.
@VeitLehmann
@VeitLehmann 4 месяца назад
scope is definitely something I want to play around with! layers as well, but in the projects that I'm working with, I think it would cause a lot of headaches because there are !important rules both in ui library/base theme code and consumers'/custom code, and the inversion of !important would probably mess things up badly... I already use the recent pseudo selectors a lot, and I'm most excited about being able to use :has in production code now since browser support is finally decent!
@ilirbeqiri253
@ilirbeqiri253 4 месяца назад
The example shown with the feature queries, also used on the previous video where you demoed how to animate nav on scroll, if the feature query asserts that it supports scroll animation, styles were overridden but I think browser devtools were not correctly showing the styles. I tried to un-apply the styles inside the @supports block and nthg was changing, the case with top: 1rem and top: -5rem.
@nilaallj
@nilaallj 4 месяца назад
To my understanding, @scope is probably LESS powerful than scoping in at least some frameworks, especially those that rely much on Shadow DOM. I see this as a good thing, since Shadow DOM is usually TOO powerful for my use cases. Shadow DOM means style encapsulation where nothing leaks in and nothing leaks out. @scope on the other hand lets styles with higher specificity leak in, and styles declared inside a scope block may leak beyond it’s scope limit if elements further down the DOM tree inherit them. @scope has very little impact on specificity. Its main thing is to give priority to styles closest to an ancestor scoping root, where order of appearance would have decided otherwise. One very exciting thing with @scope is its potential to fully replace the need for BEM, using nested scope declarations with the &-selector, and/or together with cascade layers. Great video as always. Looking forward to your @scope video!
@KevinPowell
@KevinPowell 4 месяца назад
Yeah, I agree that there are issues with the shadow dom. I think it was one of those "this is probably the best way to do this" things, that they only realized can be a real footgun once it was too late. And yeah, nesting + scope works really well from the quick things I've played with. Like you said, it basically removes the need for something like BEM, since specificity is no longer an issue.
@GerritforBazeja
@GerritforBazeja 4 месяца назад
This is a very nice video and very important (ha, ha) to realise! what goes first who is the boss!! in CSS
@weblicegirl
@weblicegirl 4 месяца назад
The cascade has always felt like a beautiful waterfall to me. we must learn to understand it instead of trying to destroy it
@seven9arts
@seven9arts 4 месяца назад
I also use BEM and always write properties in alphabetical order.
@KevinPowell
@KevinPowell 4 месяца назад
Do you write them alphabetically, or use a linter? Writing that way sounds hard 😅
@harshvishwakarama-ee2ml
@harshvishwakarama-ee2ml 4 месяца назад
Please make videos on css library to make template crazy fast
@spaceyraygun
@spaceyraygun 4 месяца назад
:is(h1, h2, h3, #important) 🤣
@chaosflaws
@chaosflaws 4 месяца назад
Seriously though, I can totally see how :is(.some-selector, #override-xyz) where "xyz" refers to some other part of the stylesheet would be more self-documenting than the usual !important modifier - in cases where you really, really need it. (Which should be somewhere between "never" and "almost never".)
@MojtabaRz
@MojtabaRz 4 месяца назад
Amazing Video🔥
@patricknelson
@patricknelson 4 месяца назад
17:11 - Welcome to the Typo Troubled Tongue Twister Tournament!
@djkomp3tenz
@djkomp3tenz 4 месяца назад
do you have a deep Tutorial on how to create this effect in 10:55 the Video that you are talking about only releases to the @support feature and not on the actual design that you are using in this example? btw Your videos are Amazing to watch and learn at the same time and i understand a lot, thank you for helping me and having fun with css
@OCEMTechZone
@OCEMTechZone 4 месяца назад
Great Sir 🎉
@DeepTitanic
@DeepTitanic 4 месяца назад
When you use scope with the style tag you can also nest :scope {} within to access the parent html element meaning you don't even need to use classes if you don't want to.
@GrouchierThanThou
@GrouchierThanThou 4 месяца назад
You should probably have mentioned that Firefox doesn't support @scoped yet, so you should probably hold off on using it in production.
@KevinPowell
@KevinPowell 4 месяца назад
I did warn about browser support for it when I first started talking about it, saying how support as of the time of recording is at only about 70% right now, and that there's a link to the browser support tables in the description, for people watching later on :)
@andread4721
@andread4721 4 месяца назад
Those things start to give me headaches (not your video Kevin but the specifity stuff that's getting really complicated).
@funkologie
@funkologie 4 месяца назад
Scope will be like calc a winning change.
@chukwudobemicah7015
@chukwudobemicah7015 4 месяца назад
Early! & great video too
@RobertMcGovernTarasis
@RobertMcGovernTarasis 4 месяца назад
I occasionally issues but it ain’t cascade.
@Uk.Cinema
@Uk.Cinema 4 месяца назад
Please sir ,have you tried Devin AI?. Please try it and tell me what you think about it
@KevinPowell
@KevinPowell 4 месяца назад
Only a few people have afaik... from what I've heard it's crazy expensive to run, so I don't think they'll be inviting many people to try it out for awhile 😆
@Uk.Cinema
@Uk.Cinema 4 месяца назад
@@KevinPowell maybe
Далее
Relative colors make so many things easier!
13:16
Просмотров 48 тыс.
НЕ ИГРАЙ В ЭТУ ИГРУ! 😂 #Shorts
00:28
СЕРЕГА ПИРАТ - TEAM SPIRIT
02:37
Просмотров 313 тыс.
Vue.js Tutorial: Beginner to Front-End Developer
4:21:59
Просмотров 331 тыс.
Stop fighting with CSS positioning
21:35
Просмотров 91 тыс.
How I find and debug issues in my CSS
23:29
Просмотров 26 тыс.
6 UI Hacks I Wish I Knew As A Beginner
11:11
Просмотров 789 тыс.
23 CSS features you should know (and be using) by now
31:31
A better image reset for your CSS
11:16
Просмотров 110 тыс.
Unfamiliar CSS patterns that improve on the classics
22:57
Avoid these 5 beginner CSS mistakes
21:38
Просмотров 82 тыс.
The Story of Next.js
12:13
Просмотров 568 тыс.
A new approach to container and wrapper classes
25:27
Просмотров 255 тыс.
НЕ ИГРАЙ В ЭТУ ИГРУ! 😂 #Shorts
00:28