Simplify Your CSS Using :is() and :where() Pseudo-Classes

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024

ความคิดเห็น • 23

  • @clevermissfox
    @clevermissfox 7 หลายเดือนก่อน +3

    Could swear I’ve used pseudo elements with :is()…. But I also know I’ve had problems with some pseudo element selectors which I was blaming on nesting. Very good to know! Thanks!
    EDIT: turns out the example I was thinking about is actually “& :is(.element)::before { … }”

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน +1

      This is very interesting! I just tested your example, and ::before seems to be working. It should be a problem only within :is(). 🤷‍♂️
      Here's my test: cln.sh/2GYMLS2l

    • @clevermissfox
      @clevermissfox 6 หลายเดือนก่อน +2

      @@CSSWeekly makes sense as it’s not actually inside the :is() and totally explains why :is(.element::before) wasn’t working! Thanks!

  • @MaxMov-sp8hr
    @MaxMov-sp8hr 6 หลายเดือนก่อน +2

    Great! Thank you!

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน

      You are welcome, Max! Thanks for watching and commenting! 🙂

  • @SerhiiUa51
    @SerhiiUa51 6 หลายเดือนก่อน +1

    Wow,.....I am curious!
    .... just comment for youtube!

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน

      Thanks so much, Serhii! 🙏

  • @ilirbeqiri253
    @ilirbeqiri253 6 หลายเดือนก่อน +1

    To be honest, to me, :matches() looks more appropriate name for :is(), and i dont know why they changed it.
    As always great explanations from your side 🚀🚀🚀

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน

      Thank you so much, Ilir! 🙏
      Yes, :matches() is a reasonable name, but according to a GitHub issue on the subject, :is() makes more sense when paired with :not(), which is its opposite. That's why they renamed it.
      Link: github.com/w3c/csswg-drafts/issues/3258

  • @inteltone
    @inteltone 6 หลายเดือนก่อน +1

    Very useful info! Thanks a lot to the author!

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน

      I’m thrilled to hear you found it useful! Thanks for watching and commenting! 🙏

  • @ScriptRaccoon
    @ScriptRaccoon 6 หลายเดือนก่อน +1

    Awesome explanation, all questions answered :).
    I use :is mainly for grouping hover and focus states.
    :is(input, button):focus-visible {...}

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน

      Thank you, Martin! This is a great tip! 🙂

  • @ahmad-murery
    @ahmad-murery 7 หลายเดือนก่อน +2

    CSS specificity used to be easy to remember, but with the addition of all these great CSS functions it's becoming harder to remember/calculate, fortunately VSCode can do it for you if hover over a CSS selector.
    Very well explained.
    Thanks Zoran!

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน +1

      Thanks for the tip, Ahmad! It seems like one of my next shorts should be exactly this VS Code specificity tip! 🙂
      And a deep dive on specificity might be interesting as well. 🙂

    • @ahmad-murery
      @ahmad-murery 6 หลายเดือนก่อน +1

      @@CSSWeekly Interested already on a deep dive video on specificity👍

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน +1

      Great to hear this! 🙂

  • @rohanverma872
    @rohanverma872 7 หลายเดือนก่อน +1

    cleared all my doubts regarding :is() and :where().
    Thanks a lot.

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน

      You're very welcome! I'm thrilled to hear this, Rohan! 🙂

  • @joel-rg8xm
    @joel-rg8xm 6 หลายเดือนก่อน +1

    awesome content that I don't miss. Please, please, I know it's your style but don't move too much your arms and hands, it's kind of distracting to grasp the conveying knowledge.

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน +1

      Thanks for your feedback, Joel! I didn't realize I was moving my arms and hands so much, but honestly, I don't think I can change this. It feels like I'll get too robotic if I try to consciously move them less. 😀
      Does this apply mainly to intros or to the rest of the video as well?

    • @joel-rg8xm
      @joel-rg8xm 6 หลายเดือนก่อน +1

      @@CSSWeekly it applies to all of the duration of the video I'm afraid, lol but, thanks for replyng, I made the same remark to another youtuber that nodded his head all the time so I kept nodding my head as well while watching his videos and he seemingly bothered at my constructive comment.

    • @CSSWeekly
      @CSSWeekly  6 หลายเดือนก่อน +1

      I believe comments like this can show you the aspects where you can (or should) improve your presentation, so I really appreciate you taking the time to write it down. 🙏
      Another comment along yours I got is that it might be due to motion blur and a lower recording frame rate (30fps). I might try adjusting this to see if it improves things, at least in this sense. 🙂