This Is So Much More Than Just A Parent Selector

Поділитися
Вставка
  • Опубліковано 20 жов 2024

КОМЕНТАРІ • 103

  • @CyberTechBits
    @CyberTechBits 2 роки тому +3

    LOVE your content brother! Always have! Keep it coming! Would be nice to see some advanced tutorials around TABLES.... Like dynamically adding rows, cells with calculations like summing values in a row and calculating totals across row. Maybe incorporating data attributes with reduce etc.. Also would be cool to see tutorial on dynamically dragging rows!

  • @dariayudina8463
    @dariayudina8463 Рік тому

    oh my god, we've been waiting for this selector for almost 10 years! thanks for the video and detailed explanation

  • @clevermissfox
    @clevermissfox Рік тому

    Bw Web Dev Simplified and Kevin Powell, us UA-cam CSS learners would be so lost. They both are so knowledgeable and such great teachers. Very grateful for these guys and their time/effort to put out this content

  • @jenstornell
    @jenstornell 2 роки тому +1

    This selector will simplify the web a whole lot. Great examples!

  • @megavolkan
    @megavolkan Рік тому

    This form thing has just f***ing blew my mind! Thank you so much!!! 🤯

  • @aryavbhola3066
    @aryavbhola3066 2 роки тому +30

    I never knew we had a parent selector

    • @mavdotj
      @mavdotj 2 роки тому +19

      Because your adopted /j

    • @mavdotj
      @mavdotj 2 роки тому

      @@321sas ok

    • @aryavbhola3066
      @aryavbhola3066 2 роки тому

      @@mavdotj 😂 good one

    • @CoconutwCoco
      @CoconutwCoco 2 роки тому +2

      @@mavdotj I laughed 😅

    • @mikecronin2415
      @mikecronin2415 Рік тому +1

      Until Firefox supports it, I don’t think we yet have parental support. Maybe a court order… (that earlier one WAS good, I laughed too).

  • @Jikodis
    @Jikodis 3 місяці тому

    I tried looking at the MDN docs and they did not do a good job explaining this. Thanks for the video!

  • @joyvideos1802
    @joyvideos1802 Рік тому

    many usage of this has selector. THanks lot😊

  • @Hasan23
    @Hasan23 2 роки тому

    Thank you for explaining this thoroughly!

  • @sidneijunior86
    @sidneijunior86 2 роки тому +1

    I'm learning English and web with your videos. It's very cool indeed!

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @tommysmith5479
    @tommysmith5479 2 роки тому +1

    Hey Kyle. Just a talking point. Reagarding your "special-ribbon" example. You say not having to add the "special" class to your containg div makes the code cleaner. I'd argue that it makes the code less intuitive and readable. If the containing div has a class of ""special" then right away the reader knows what's going on. In essence, I'd say readability over cleaner code.

  • @Mmg123-masked12G
    @Mmg123-masked12G 2 роки тому

    finally we can highlight a row when hover on a cell in a grid without js :)

  • @Yawarr
    @Yawarr 2 роки тому

    Thank you, great quick explanation.

  • @anaselhassani2545
    @anaselhassani2545 2 роки тому

    Thanks for the tutorial, it's much faster than any other method I came across.

  • @dominicanfrankster
    @dominicanfrankster 2 роки тому +5

    I'm super excited for 'has' to get more adoption so I can finally use it outside of hobby projects!!

  • @devkasunlakshitha
    @devkasunlakshitha 2 роки тому

    Thank you so much for these tips. Awesome! ❤

  • @sajjadkazemi
    @sajjadkazemi 2 роки тому

    God bless you , I just learnt the thing i was looking for since months ago😍

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @bijintsy
    @bijintsy Рік тому

    Thank you ...

  • @alagunoff
    @alagunoff 2 роки тому

    Thanks!

  • @rpf23543
    @rpf23543 2 роки тому

    very nice stuff, thank you!

  • @RaymondFishSC2
    @RaymondFishSC2 2 роки тому

    Great video!

  • @chezchezchezchez
    @chezchezchezchez 2 роки тому

    Brilliant! Thx!

  • @BGdev305
    @BGdev305 Рік тому

    @WebDevSimplified would love to see more in depth usage of this. Simply because this is powerful enough to remove the need for JS in alot of frontend "design" where one normally needs JS. For example, does this work well with the new CSS Transformations.. Animations?

  • @yassinesafraoui
    @yassinesafraoui 2 роки тому

    I had been doing css for years( I stopped recently), and this was something i dreamed of day and night 😭

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @MichaelOwens1972
    @MichaelOwens1972 Рік тому

    11/22/2022 Has selector is 82.92% accepted. woot!

  • @PadmanabanScrazy
    @PadmanabanScrazy 2 роки тому

    Please explain about BEM CSS methodology

  • @webstercho
    @webstercho Рік тому

    Firefox likes this tutorial 😄

  • @rahee3036
    @rahee3036 2 роки тому +1

    Hello Sir! I would like you to make a video on, how to make a responsive website using flex-box or grid-box.
    Also, I have a question for you, "Is Media Query is always needed to make a fully responsive website?".
    Thank You. ❤️

    • @IrvineMesa
      @IrvineMesa 2 роки тому

      yes media query will tell the browser what contents to display at different screen size

  • @michelaveline
    @michelaveline 2 роки тому

    Super great!

  • @TheNatanie
    @TheNatanie 2 роки тому +1

    Hiya, your channel helps a lot! I am only starting my path as a web developer, and I'm happy there is a place to find answers to my questions.
    So my first web-related question on this channel will be: dooo you have a girlfriend?:)

  • @kohelet910
    @kohelet910 Рік тому

    CSS:has(Amazing-features) 😃 Thx for this really cool video

  • @m1lk1way1
    @m1lk1way1 Рік тому

    the only con is that all css selectors work from the end and first it selects all "p" on the page and only after it narrows result relative to the given parent. It is very slow, that's why to have a classes everywhere is the best practice, just not to force browser do this extra kind of work.

  • @Nipaska1
    @Nipaska1 2 роки тому

    Make tutorial video about background images maybe

  • @antonigari7003
    @antonigari7003 Рік тому

    On the dark mode example, what if you want to have both body and card change, do you just write two :has?

  • @cyberprompt
    @cyberprompt 2 роки тому

    what we need is a :had selector where a child can check if a parent "had" some value, or at least I do since we have situations where during authoring a parent is given inline styling but no new class. so I guess it's still just js for that. and before you ask, no we can't just always request new classes for all situations in a corp CMS environment.

    • @avoerman89
      @avoerman89 2 роки тому +1

      Seems like a performance nightmare - browsers would have to track the state of every dom change

    • @cyberprompt
      @cyberprompt 2 роки тому

      @@avoerman89 i'm not talking about past values. i'm saying to easily target a parent element's style value. ie: .parent:: has('color: #ccc') .target { color: #fff }

    • @cyberprompt
      @cyberprompt 2 роки тому

      @@avoerman89 :had would not be a temporal thing, it's the opposite of :has, to the parent, not the child. Like if you wanted to get the style information in JS of a child's parent but in css only.

  • @dopecello8670
    @dopecello8670 2 роки тому

    Can it select my aunts and uncles too?

  • @BigJim777
    @BigJim777 2 роки тому

    can you do :has not

  • @wassupdoc7742
    @wassupdoc7742 2 роки тому

    One thing to notice is firefox doesn't support the has pseudo class

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

    • @Igor-ge1py
      @Igor-ge1py 2 роки тому +1

      Yup you’re right. Only 76% of the internet users would be able to use this. I’m a couple years should be good.

  • @codesymphony
    @codesymphony Рік тому

    selector has amazing applications, but I feel like it would have super resource intensive performance?

  • @TechTalentHive
    @TechTalentHive 2 роки тому

    I have a doubt in hover function. Which is the best CSS or Java Script for mouse hover action ?

  • @mrbsreevijayan8115
    @mrbsreevijayan8115 2 роки тому

    I'm having some troubles in my html could you help me with it

  • @ruthang9065
    @ruthang9065 2 роки тому

    2:24 HEY HEY, WHAT ARE YOU DOING?

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @ojichukwuedwin4725
    @ojichukwuedwin4725 2 роки тому

    Great!

  • @afzalbd1
    @afzalbd1 2 роки тому

    Great

  • @pranavwani
    @pranavwani 2 роки тому

    Awesome 😎

  • @VladDubovyi
    @VladDubovyi 2 роки тому

    We are waiting for :is :where 😀

  • @MuhammadAdnan2.0
    @MuhammadAdnan2.0 2 роки тому

    Can we target child:has(parentDiv) ?

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @aram5642
    @aram5642 2 роки тому

    Wouldn't this be a workaround for the specificity combinator? .box:has(:where(.p1, #p2))

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @TomasMisura
    @TomasMisura 2 роки тому

    i haven't had any idea this selector already exists. css becomes more and more complex and it seems tries to adopt some javascript features

  • @dasten123
    @dasten123 2 роки тому

    still not supported in Firefox... what are they doing?!

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @mtime6648
    @mtime6648 5 місяців тому

    Without it i had used javascript to do or i had to change the position of the elements for the sake of CSS selectors

  • @oldclient
    @oldclient 2 роки тому

    New functions has(), is(), not(), where() in combination with calc(), var() and sudo selectors have a huge impact on CSS like Flex and Grid did before. It's a clean and compact architecture to use while choosing between it and Bootstrap, MUI, Tailwind. I did a bunch of tests and its potency is huge.

  • @felixpaniagua6018
    @felixpaniagua6018 2 роки тому

    Can we use it in production yet?

    • @luislourz
      @luislourz 2 роки тому

      You can, though you will need to provide fallbacks with CSS and JS.

    • @felixpaniagua6018
      @felixpaniagua6018 2 роки тому

      @@luislourz nice

    • @settahkader
      @settahkader 2 роки тому +2

      not supported with firefox

  • @romanmed9035
    @romanmed9035 2 роки тому

    "has" firefox suuport after on in settings. but "has" is progreessive as "flex".

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @rammah
    @rammah 2 роки тому

    Nice video

  • @Mackin7777
    @Mackin7777 2 роки тому

    I'd argue that for example #1, using block element modifier instead of a nested :has makes it more readable and obvious what's going on when looking purely at the markup.

  • @andrew0_29_0
    @andrew0_29_0 2 роки тому

    Cool

  • @skylerjknight
    @skylerjknight Рік тому

    Can't wait until this is fully supported...
    It's gonna be sick

  • @fzq8064
    @fzq8064 2 роки тому

    nice

  • @davidturkadze457
    @davidturkadze457 Рік тому

    has() selector is great, but Firefox does not support it!

    • @MrGuillermolago
      @MrGuillermolago 10 місяців тому

      It will be supported starting on December 19th!

  • @LV4EVR
    @LV4EVR 2 роки тому +1

    Firefox ... ☹

  • @Nodsaibot
    @Nodsaibot 2 роки тому +1

    HAS is not really a parent selector, for its not AGNOSTIC, you MUST know what the parent is

  • @urbaniv
    @urbaniv Рік тому

    A great channel but the room looks as you are imprisoned in a cellar and forced to do YT 😂

  • @PaulSebastianM
    @PaulSebastianM 2 роки тому

    ".box:has(div) p" should be equivalent to ".box > div p" because once you're not targeting the parent, but add a second selector like that (p in this case), you don't need :has. That's at least how it seems, I haven't tested this. :D

    • @dasten123
      @dasten123 2 роки тому

      nope, in your example without the :has, the must be nested inside the , but it could be a sibling to the div. Plus, in the example with the :has it doesn't matter if the is a _direct_ child of .box

    • @whatsapp176
      @whatsapp176 2 роки тому

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @mojorochi
    @mojorochi 2 роки тому

    Not sure I'd like putting random things inside of my "has"

  • @harmez7
    @harmez7 2 роки тому +1

    hi Kyle, do you still wake up at 5 ?

  • @Atlent112
    @Atlent112 Рік тому

    It's been 7 months, and Firefox is still blocking it for whatever reason, eh...

  • @ironsand
    @ironsand 2 роки тому +1

    I love real world examples, because they don't ever have semantic HTML tags. 🤣

  • @telesohbet
    @telesohbet 2 роки тому +1

    Jquery had this since 2008

  • @ultimapanzer
    @ultimapanzer Рік тому

    .dad:has(.goneoutforcigarettes)

  • @mrbsreevijayan8115
    @mrbsreevijayan8115 2 роки тому

    I'm having some troubles in my html could you help me with it

  • @mrbsreevijayan8115
    @mrbsreevijayan8115 2 роки тому

    I'm having some troubles in my html could you help me with it