New CSS features to know for 2025

New CSS features to know for 2025

Kevin Powell

1 месяц назад

48,210 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Ceko
@Ceko - 09.02.2022 10:18

Great video. I was thinking about this technique to override bootstraplike frameworks with importants though. If you have such framework, isn’t it always loaded first? I.e. you can define the layers order but at that point the framework is already loaded?

Ответить
@dgcp354
@dgcp354 - 09.02.2022 12:18

I remember you struggling to say specificity, I think there is actually a dedicated video about it, glad you're saying it with ease is.

Ответить
@peternicholson26
@peternicholson26 - 09.02.2022 12:33

!important; on crack

Ответить
@antisk8
@antisk8 - 09.02.2022 12:39

Great video. Better shirt

Ответить
@oliver139
@oliver139 - 09.02.2022 13:01

I think this technique will either make thing simplier, or mess up the CSS LOL
and btw !important is still evil..damn boostrap

Ответить
@carolmckay5152
@carolmckay5152 - 09.02.2022 13:34

Is there, or will there be a way to import an external css like this: <link rel=”stylesheet” type=”text/css” layer="bootstrap" href=” bootstrap.css”> ?

Ответить
@DeltaNrOne
@DeltaNrOne - 09.02.2022 13:57

This sounds like a pain and a blessing at the same time.

Ответить
@EmSixTeen
@EmSixTeen - 09.02.2022 17:41

This is confusing, but.. still interesting!

Ответить
@eddiemcconkie
@eddiemcconkie - 09.02.2022 20:21

Specificity: 31
Specificicity: 0
You've set a new record Kevin!

Ответить
@levyroth
@levyroth - 09.02.2022 20:41

html * {
font-size: 16px;
line-height: 1.6;
}

Ответить
@xanpk2074
@xanpk2074 - 10.02.2022 03:13

No more !important; ? :/

Ответить
@rockmonty
@rockmonty - 10.02.2022 08:54

Great video again. not an easy subject to explain, but Kevin battles through and gives everyone a good understanding . thank you. its nice that the video isn't too long either

Ответить
@pushqrdx
@pushqrdx - 10.02.2022 20:19

To me it looks like a and !important block lol

Ответить
@NicholasAlexander1
@NicholasAlexander1 - 11.02.2022 14:57

This is brilliant! Makes CSS specificity far less mysterious - when you find yourself searching through modules. Now nodules are essentially layered namespaces. Thank you for the clarity.

Ответить
@SidisterX
@SidisterX - 12.02.2022 01:47

Kevin, I will be looking for a front-end designer very soon for our animation festival that will feature our selection online.
Perhaps someone in your comments is proficient enough and reasonably priced.?!

Ответить
@katetretyakova4901
@katetretyakova4901 - 12.02.2022 16:38

so lit t-shirt, man!)))

Ответить
@MatveyAndreyev
@MatveyAndreyev - 12.02.2022 23:38

CSS specificity is one of the easiest things on Earth.

Ответить
@yassinih5189
@yassinih5189 - 13.02.2022 14:34

you can easily give a value of inherent to the a, to avoid that specificity issue

Ответить
@danielk.3017
@danielk.3017 - 13.02.2022 21:03

I find that it's a great addition for people who are new to CSS, since it makes things more organized, and it makes it easy to deal with problems quickly. Though having said that, I still think that not using it is better if you have the time to write organized and structured CSS, since less lines of code would be needed, and layering could be done through splitting up your stylesheet into multiple ones.

Thank you for the video, I found it very informative! ✌🏼

Ответить
@apuravela
@apuravela - 15.02.2022 13:40

Very clear, as ussual. Thanks Kevin

Ответить
@तुम्हारीमम्मी
@तुम्हारीमम्मी - 15.02.2022 18:28

If the js can access @layer then it will be totally gane changer i think 🙄

Ответить
@2Fast4Mellow
@2Fast4Mellow - 16.02.2022 05:28

For a second I was afraid that Mozille would introduce (document) layers again... It's the stuff nightmares are made off!

Ответить
@StefanH
@StefanH - 16.02.2022 22:34

This is HUGE!

Ответить
@Fachuro
@Fachuro - 19.02.2022 12:55

I just wish there was a way to undo !important in CSS - for those times where you work on legacy code and old projects where a client has been puking !important tags all over everywhere they couldn't figure out how specificity actually works - or you know, just because... Because you dont really just wanna go in and remove them all as you could end up breaking something else, because its not like they wrote any tests or snapshots to tell you when something gets broken either - and some clients have systems that go back 2-3 decades and just simply have too much code to realistically be able to know all the places that would rely on that style rule...

Ответить
@dolevgo8535
@dolevgo8535 - 27.03.2022 20:38

is there a way to check if said framework is using layers? and if not, a way to wrap it?

Ответить
@voidmind
@voidmind - 17.04.2022 14:55

Something that's missing from this video is that you can set a layer to imported CSS files like "@import 'utilities.css' layer(utilities);". So you could import the CSS from a component library this way and have an easier time overriding some styles it defines.

Ответить
@Скофиэлд
@Скофиэлд - 18.07.2022 21:06

is there a way to set a level of importance? such !important Lvl 9

Ответить
@mrastrogastro
@mrastrogastro - 13.08.2022 20:18

This will save me Kevin, I'm working on an old project with such bad css practice. I will create my layer and voila! :D

Ответить
@qwertt14
@qwertt14 - 13.12.2022 01:22

Hate it

Ответить
@Strasbourgeois
@Strasbourgeois - 27.01.2023 02:31

The reason unlayered rules have higher specificity is because they get put inside an anonymous layer that is below all other layers

Ответить
@JulienReszka
@JulienReszka - 25.02.2023 13:49

Very important video thx

Ответить
@nomadshiba
@nomadshiba - 10.05.2023 20:40

this video was one year ago and i didnt even know this was existed
this will be a life changer

Ответить
@iwanttobealihgt
@iwanttobealihgt - 16.05.2023 10:56

thanks for the explanation and examples. Extremely handy!

Ответить
@mma93067
@mma93067 - 09.06.2023 23:17

Wait. Does this mean i can finally throw away all those god awful CSS-in-JS libs?!

Ответить
@andreibicu5592
@andreibicu5592 - 30.10.2023 17:37

Lovely explanations! I understood better than when read from Tailwind, for instance.

Ответить
@DanielRios549
@DanielRios549 - 22.11.2023 19:36

I didn't like that selectors outside a layer have higher specificity, it should be the opposite

Ответить
@jybedesign
@jybedesign - 03.01.2024 14:59

Excellent video. Thx a lot!

Ответить
@lewis4929
@lewis4929 - 23.01.2024 05:31

With this make it easier to manage dark and light themes?

Ответить
@tithos
@tithos - 05.05.2024 18:54

What lorem are you using?

Ответить
@nested9301
@nested9301 - 25.06.2024 19:26

the browser support is good for this feature so we can use it now :) great video!

Ответить
@PowBro
@PowBro - 18.07.2024 12:04

Thank's Maestro

Ответить
@brefasdra
@brefasdra - 06.08.2024 05:05

it would be nice if we could put a class-layer="isolatedLayer" on an element, and then that element and its children would ignore any author styles css rules not in a specified layer (and maybe even an inverse of that to ignore certain layers), so if you had bootstrap on the page and its screwing with something, instead of trying to counter it, you could have a div that completely ignores those bootstrap styles (i always have issues where a site designer has used tag name style definitions, and it screws up my apps styles, to be able to easily switch off some styles for an area would be a lifesaver.

or maybe instead of/as well as on the element itself, having the css definition be able to do something like that.

Ответить
@adamlongaway
@adamlongaway - 02.10.2024 02:08

The fact that un-layered classes always have greater priority makes this feature nearly unless with any legacy code of much size. Shame, wonderful feature if they reversed that so layered items always were first in priority over non-layered. Only solution for a legacy site is to come up with new class names and semi-by-pass the legacy code which it a ton of work, would have been lovely if layers sat on top of the priority stack :( -- oh what could have been so easy

Ответить
@thatgamingbrit
@thatgamingbrit - 24.11.2024 16:09

I've watched a lot of your videos and found them very useful, so please keep up the amazing work.
But I would like to see performance considerations with some of the features that you have addressed in your channel, and maybe some properties that may alleviate these such as 'will-change' etc

Ответить
@QueeeeenZ
@QueeeeenZ - 16.12.2024 18:47

Bootstrap = bootcrap

Ответить
@apall2764
@apall2764 - 26.12.2024 23:25

Great content = subscribed!

Ответить
@yk_david
@yk_david - 04.03.2025 13:19

Thanks for video! Can you share this courses codepen link? (Maybe it’s me who don’t find it)

Ответить
@yousefsaddeek
@yousefsaddeek - 08.04.2025 01:25

unusually horrible explanation, but somehow I managed to understand so thank you I guess

Ответить