:has() opens up new possibilities with CSS

:has() opens up new possibilities with CSS

Kevin Powell

2 года назад

289,833 Просмотров

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


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

@benjamin-lieb
@benjamin-lieb - 01.09.2024 04:29

Falling back in love with CSS after many years. Now just have to figure out how how to use these safely inside react components with a team that loves Tailwind.

Ответить
@davidllanes1019
@davidllanes1019 - 25.08.2024 02:15

ola

Ответить
@dfgatorfan
@dfgatorfan - 01.08.2024 00:01

This is probably the biggest addition to CSS this decade.

Ответить
@LtFoodstamp
@LtFoodstamp - 14.05.2024 01:37

This stuff is unreal.

Ответить
@JavlonTalipov
@JavlonTalipov - 18.04.2024 14:34

hi! i am trying to use "has" as showed in gallery example where not hovered elements are in lover opacity.

Ответить
@selektahx
@selektahx - 20.03.2024 18:25

love your content , i used to hate css... now its ok 😛

Ответить
@re-member
@re-member - 23.02.2024 00:53

Thank you!

Ответить
@ihelpdogs
@ihelpdogs - 05.02.2024 09:13

Only seems to work in Firefox if you add "+" sign ie. p:has(.lead) {font-size: 2rem;} doesn't work... p:has(+ .lead) {font-size: 2rem;} does work.

Ответить
@wnduddl40
@wnduddl40 - 18.01.2024 08:51

좋아요 ㅎㅎㅎ 잘 가르쳐주셔서 감사하네용

Ответить
@benvindadossantos2092
@benvindadossantos2092 - 09.01.2024 05:03

This is super, thank you

Ответить
@ultratacoRX7
@ultratacoRX7 - 01.12.2023 22:13

:has is great and I look forward to more browser support, but you can do that img gallery effect without it, like this (except I'd nest things with scss):
.image-gallery:hover img{
scale: 0.8;
opacity: 0.7;
}
.image-gallery:hover img:hover{
scale: 1;
opacity: 1;
}

Ответить
@matteonegridev
@matteonegridev - 29.11.2023 14:37

Doesn’t work for me in Firefox yet!

Ответить
@SebastianZartner
@SebastianZartner - 02.11.2023 23:09

For what it's worth, Firefox is going to ship :has() in version 121, which will be released on December, 19th. So then all major browsers will finally support it!

Ответить
@clevermissfox
@clevermissfox - 18.10.2023 23:50

I can’t believe Firefox hasn’t embraced it yet!

Ответить
@royandescartes
@royandescartes - 18.09.2023 12:35

colon has openbrackets

Ответить
@TekkenRoom
@TekkenRoom - 16.09.2023 16:37

Hello i am trying to implement this :has selector for li::marker but it didn't work with firefox browser only with chrome and edge , is it because of the support ?

Ответить
@952a259
@952a259 - 14.09.2023 16:22

This video helps me a lot! Kevin, thank you very much! 👍

Ответить
@keaton718
@keaton718 - 30.07.2023 17:13

10 months later and still not supported in Firefox without a feature flag? So it's not supported because no one is going to enable that except people like us.

Ответить
@Atractiondj
@Atractiondj - 20.07.2023 16:21

We today, create a new CSS selector, his name :f***ing mozilla

Ответить
@NeilMoore
@NeilMoore - 16.07.2023 09:20

the image hovering animations at the end of the video really demonstrated the power of this new parent selector feature. 😲I could've used this 10 years ago. I really enjoy your videos. Fantastic job demonstrating the usefuleness of this! 🙂👍

Ответить
@przemek896
@przemek896 - 06.07.2023 23:53

Will it work with firefox ?

Ответить
@surajkumar-wo3rz
@surajkumar-wo3rz - 11.05.2023 11:56

How can I use :has in Firefox please tell

Ответить
@BlazingTyphlosion
@BlazingTyphlosion - 12.04.2023 17:30

And then there is firefox ...

Ответить
@jack-jackofalltrades
@jack-jackofalltrades - 03.04.2023 19:08

.article_title:not(:has(+.article_subtitle)) can be also written as
.article_title:has(+:not(.article_subtitle))

Ответить
@aninham
@aninham - 28.03.2023 08:00

Really like it but I won’t use for now, gonna wait until we get more browser support 😥

Ответить
@rakesh.dsouza
@rakesh.dsouza - 25.02.2023 14:37

has() does not work for me in safari and firefox... chrome and edge it is working... can you confirm

Ответить
@LokiDaFerret
@LokiDaFerret - 14.02.2023 05:27

I'm trying to implement as a grandparent selector. A video on that would be very handy.

Ответить
@wherethesunrise
@wherethesunrise - 24.01.2023 19:10

Div:has(>a){
Bg:red}

Ответить
@bruhmoment3731
@bruhmoment3731 - 15.01.2023 03:47

Brilliant!

Ответить
@gabydewilde
@gabydewilde - 12.01.2023 22:22

not having to abuse label for check-boxes is nice

Ответить
@sbkates
@sbkates - 09.01.2023 23:16

That gallery effect is gorgeous, and I'm so glad to not need JS or super complex CSS for it.

Ответить
@sbkates
@sbkates - 09.01.2023 22:58

Now I no longer have to beg the people making the HTML I am sometimes saddled with to give all child elements parent classes just so I can style off of them. Woohoo! Now any formfield that holds a form element of a certain type can just be targeted based on that specific form element type! I know that sounds very specific, but this removes a significant stress point for front end people working in large systems!

Ответить
@sajeersayed2008
@sajeersayed2008 - 06.01.2023 15:43

U r the best

Ответить
@MyUbuntuVids
@MyUbuntuVids - 06.01.2023 02:54

i:has(.cheeseburger)

Love your work, Kevin!

Ответить
@nabilsadik
@nabilsadik - 24.12.2022 12:38

Not supported by Firefox

Ответить
@Lashistoriasdelilith
@Lashistoriasdelilith - 16.12.2022 05:09

I wonder how many years and hours have you studied to know this much, it's awesome. So secure. All this is self-taught or did you go to any university?

Ответить
@AfwanLearning
@AfwanLearning - 23.11.2022 09:02

Can anyone say How to enable :has() pseudo-class in Firefox ?

Ответить
@ntnurobert218
@ntnurobert218 - 18.11.2022 07:35

Mind blowing ❤

Ответить
@Dylan_thebrand_slayer_Mulveiny
@Dylan_thebrand_slayer_Mulveiny - 16.11.2022 03:39

Global support is only 83%. Still a long way off before this is ready for production.

Ответить
@imbrod
@imbrod - 16.11.2022 00:49

Why was my comment deleted? When I pointed out that Firefox doesn't support it?

Ответить
@chimadivine7715
@chimadivine7715 - 13.11.2022 16:06

Many times I wished CSS had a parent selector instead of having to do it with JavaScript via the <Element>.parentElement or <Element>.closest(...)
Kevin made me realise that my prayer has been answered.
Your videos are golden.
Much thanks!

Ответить
@headrockbeats
@headrockbeats - 07.11.2022 21:58

No comment on how expensive the command is?

Ответить
@haruruben
@haruruben - 06.11.2022 16:28

Great looking forward to being able to use this in production 5-10 years from now

Ответить
@jesh182
@jesh182 - 05.11.2022 00:44

Hi Kevin, is there a way to select the parent if it has a given children length?

Ответить
@augustfaustus
@augustfaustus - 03.11.2022 02:02

Thanks!

Ответить