We can now transition to and from display: none

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024

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

  • @MaksymCzech
    @MaksymCzech 3 หลายเดือนก่อน +441

    Finally, it took only 20 years 😂😂

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

      Hhahahahhha Riiiiight!!!!

    • @jugibur2117
      @jugibur2117 3 หลายเดือนก่อน +14

      28 years, to be exact 😁

    • @GyroCannon
      @GyroCannon 3 หลายเดือนก่อน +9

      For people targeting Firefox, it’ll take another year, apparently

    • @chezchezchezchez
      @chezchezchezchez 3 หลายเดือนก่อน

      And if you were running the show, you would’ve had it done in two years? Give me a break, dude.

    • @saintpumpkin
      @saintpumpkin 3 หลายเดือนก่อน

      since display property had no numeric value it was supposed not to translate

  • @mubrik_
    @mubrik_ 3 หลายเดือนก่อน +74

    Wow, I never thought this day would come

  • @Yous0147
    @Yous0147 3 หลายเดือนก่อน +59

    It's pretty incredible how almost every difficulty I find in CSS gets addressed by your videos handedly. Awesome stuff

    • @0xCAFEF00D
      @0xCAFEF00D 2 หลายเดือนก่อน +2

      It really is amazing how difficult CSS manages to be considering it's goals.

  • @codeslacker77
    @codeslacker77 3 หลายเดือนก่อน +27

    Wow, finally~!!! The days of width/heigh/margin/paddingt: 0px; opacity:0; pointer-event:none; finally comes to an end

    • @nitsanbh
      @nitsanbh 3 หลายเดือนก่อน +6

      Also tabIndex="-1" and overflow: hidden

    • @codeslacker77
      @codeslacker77 3 หลายเดือนก่อน

      @@nitsanbh Yes, this one too.

  • @mur9a
    @mur9a 3 หลายเดือนก่อน +12

    The amount of animation that are going to be made in the next 2 hours by me is going to be ungodly

    • @benjen5518
      @benjen5518 3 หลายเดือนก่อน +1

      😅😅

  • @christian-schubert
    @christian-schubert 3 หลายเดือนก่อน +11

    Jebus, Web Dev has gotten so easy these days!
    SO glad we've got all these Frameworks that overcomplicate matters again

    • @paxdriver
      @paxdriver 3 หลายเดือนก่อน +1

      Lmfao, well, to be fair I used to be able to teach every single possible style attribute and value in a month and have them all memorized. Now I can't do half of css without gpt or the docs because everything has a specific name and specific limits (like vh not accounting for mobile browser address bars, or justify content vs justify item).
      This is harder than it's ever been, but we've never had so much broadband internet, search and LLM tools to help navigate it on the fly.
      We dev used to be way way easier though, we could build websites in notepad without a linter or IDE. No joke I did it for like 6 years in notepad.

    • @TheWhoreDetector
      @TheWhoreDetector 3 หลายเดือนก่อน

      @@paxdriveras someone starting coding / programming I agree, of course the more I do it gets easier but it should be more simplified imo

  • @intsfanatic
    @intsfanatic 3 หลายเดือนก่อน +30

    But we still cant transition to height auto...

    • @Killyspudful
      @Killyspudful 3 หลายเดือนก่อน +11

      There's an upcoming CSS value which will allow that -. height: calc-size(auto);, for example. Under development in Chrome, I believe.

    • @duruiz
      @duruiz 3 หลายเดือนก่อน +9

      unfortunately :(
      but we can do a css only solution with grid :)

    • @loiclaborderie-boulou8186
      @loiclaborderie-boulou8186 2 หลายเดือนก่อน

      height: calc(auto) works

    • @fabbahiense
      @fabbahiense 2 หลายเดือนก่อน

      Actually we can now

  • @Tipirate-store
    @Tipirate-store 13 วันที่ผ่านมา

    It 's an excellent tutorial and very helpful video. Finaly we can use display none and add some transitions! You are the best with as well Web dev simplified for JS. I learned a lot from both of you!

  • @querela92
    @querela92 2 หลายเดือนก่อน

    That took sooooo much time and research to find out you couldn't animate display...
    And now it finally works 🎉

  • @WillHuizenga
    @WillHuizenga 3 หลายเดือนก่อน +2

    Looking forward to playing with this tomorrow
    Very glad I watched to the end. That last bit of information will be very useful.

  • @LizandraSilva_maopequena
    @LizandraSilva_maopequena 2 หลายเดือนก่อน

    I know your goal is to make people fall in love with CSS, so I wanted to let you know that you've managed to make at least one person, me, fall in love with it! I adore watching your videos and I actually fell in love with finding out new things I can do with CSS! Thank you!

  • @GilGoldshlager
    @GilGoldshlager 3 หลายเดือนก่อน

    THIS IS THE BIGGEST NEWS IN CSS EVER!!! 😲 I'm still shaking! can't believe this is real! thank you so much 💗🙏

  • @AnkitTannaVlogs
    @AnkitTannaVlogs 3 หลายเดือนก่อน

    The way Kevin explains complex concepts ❤❤❤

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

    Good news! As of testing today, it is working in all major browsers! It is working in Safari v17.6, Firefox v129.0.1, and Opera v65.0.3467.78 (It was already working in Chrome and Edge)
    Can I Use doesn't have Firefox 129 or Safari 17.6 listed yet though, but confirmed working!
    And it will be working for iOS when iOS 18 launches, which is most likely being released next month-ish

  • @joshcool
    @joshcool 3 หลายเดือนก่อน

    I've been waiting for this for YEARS lol so happy about this!

  • @RichardCalder67
    @RichardCalder67 3 หลายเดือนก่อน +2

    Watching the Can I Use part all of a sudden reminded me of having to have a work around for border radius lol.

  • @LePhenixGD
    @LePhenixGD 3 หลายเดือนก่อน

    This is amazing! I've been waiting for years for this feature to come, can't wait for browser support to be good enough for me to start using it!

  • @nothappyz
    @nothappyz 3 หลายเดือนก่อน +2

    Thank you css daddy 😭

  • @robomalo
    @robomalo 3 หลายเดือนก่อน

    Crazy timing. I legit just found this two days ago for changing content visibility.

  • @keenanflogerzi5218
    @keenanflogerzi5218 3 หลายเดือนก่อน

    Thanks for the explainer on discrete animations, and the “allow-discrete” transition-behavior.
    I saw another video mention that property but I didn’t understand because it didn’t explain what that is or how it works. Thanks for yet another excellent video!

  • @Jumanji_Dev
    @Jumanji_Dev 3 หลายเดือนก่อน +1

    Finally Maahn 🎉🎉 🕺

  • @ericdimarzio5756
    @ericdimarzio5756 3 หลายเดือนก่อน

    Love the content, Kevin! Wanted to let you know there’s an ad break right in the middle of the plug you make for your course. Probably not good for click-thru’s. Your content is amazing and needs to reach as many people as possible. 😊

  • @akramilyas6030
    @akramilyas6030 3 หลายเดือนก่อน +1

    yaaaaaay now this and page transition , anchor position , container query we will be happy

  • @SquidysTents
    @SquidysTents 2 หลายเดือนก่อน

    Total game changer

  • @raphaelgoetter
    @raphaelgoetter 3 หลายเดือนก่อน +4

    Are you sure `transition-property: opacity display;` is working? Values shoud be comma separated

  • @Linuxdirk
    @Linuxdirk 3 หลายเดือนก่อน

    I instantly know some of my sites that could use this and where it would make things 100% easier! 👍

  • @akash-kumar737
    @akash-kumar737 3 หลายเดือนก่อน +2

    I can't tell how much I need it. Must needed to animate modal.

  • @brankoh
    @brankoh 3 หลายเดือนก่อน

    Finally!!!! Thanks for the heads up.
    As always, great video! That's why you are one of my sources of info when I need to update coding knowledge.

  • @pinkseacow6067
    @pinkseacow6067 3 หลายเดือนก่อน

    Allways great Videos you make! Happy to have you💙

  • @ajxtc2
    @ajxtc2 3 หลายเดือนก่อน

    You can use pointer-events:none on overlaying invisible modal and transition from there

  • @seba-aranda
    @seba-aranda 3 หลายเดือนก่อน

    great video! Thanks for taking the time in explaining the little details, those were really usefull 🙏. I was looking for this kind of explanation because I knew this was new, but after some tries I was not being able to animate the display property 😆, now I can 😎.

  • @MattDawkins-gh6gi
    @MattDawkins-gh6gi 3 หลายเดือนก่อน

    Interesting. Though I'm not sold on the logic behind "transitioning" the display property. It's more like controlling the timing of when that discrete property applies, there's no in-between state. Personally, in this example, I'd probably just use `opacity: 0` to make the popup invisible and `pointer-events: none` to ensure it can't be interacted with when it's invisible. But that @starting-style looks like it could have lots of uses! Thanks for sharing.

  • @mistabuzz5485
    @mistabuzz5485 3 หลายเดือนก่อน

    Now I know how framer motion works. Seems like I can get a lot more control doing in this way though.

  • @luc122c
    @luc122c 3 หลายเดือนก่อน

    Thank you so much. I needed to do this today! I really appreciate you taking the time to cover the details and the caveats.

  • @paxdriver
    @paxdriver 3 หลายเดือนก่อน

    For the record, it is faster to learn javascript and do anything you can imagine vs learning css and spending a lifetime learning new, old, cheat-cut rules that javascript solved decades ago.
    I love this channel, I use css every day, but javascript took a couple years to learn while I'm always trying to catch up to css to do things I could already do in js.
    The reason why it's important to keep up with css is gpu acceleration, react, and it's just plain fun. But seriously, for people who avoid javascript because it's hard to learn or complicated, if you can learn css you'll be a beast at javascript. Being able to do both makes you an expert with no limits but imagination.

  • @alanbloom20
    @alanbloom20 3 หลายเดือนก่อน

    Really well constructed way to explain through this concept. I’d say that it’s one of the trickiest concepts I’ve had to deal with and you’ve revealed some quirks about this process that reveal why some things weren’t working in the past. Thank you :-)

  • @kolsark
    @kolsark 3 หลายเดือนก่อน

    this looks clean af to use, thx a lot Kevin ! Can't wait for it be better supported

  • @LouisCharlesBlais
    @LouisCharlesBlais 3 หลายเดือนก่อน

    What a time to be alive ✨

  • @lukasmolcic5143
    @lukasmolcic5143 3 หลายเดือนก่อน +2

    One thing you can do if you want this effect to work in all browsers without using .js would be to not use display none at all, but just keep the opacity animation for animating back and forth, but then also add ponter-events: none to the hidden state so that it doesn't block any mouse events going over it.

  • @tonyvito5062
    @tonyvito5062 3 หลายเดือนก่อน

    Finally that's really useful

  • @itlackey1920
    @itlackey1920 3 หลายเดือนก่อน

    Great explanation, and very helpful as always. Thank you!

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

    Thanks!

    • @KevinPowell
      @KevinPowell  3 หลายเดือนก่อน

      Thank you!

  • @lucascubile7141
    @lucascubile7141 3 หลายเดือนก่อน

    Nice they starting to add stuff like this but I wouldn't implement it yet for compatibility stuff.

  • @starmechlx
    @starmechlx 3 หลายเดือนก่อน

    I've never clicked on a thumbnail so fast

  • @arthuradriansens3291
    @arthuradriansens3291 3 หลายเดือนก่อน

    You just made my day, thx!! Finally

  • @artursavchuk2363
    @artursavchuk2363 3 หลายเดือนก่อน

    thanks, this information is very useful

  • @MrEnvisioner
    @MrEnvisioner 3 หลายเดือนก่อน

    20:20 Maybe not worth it for just one property and a simple 'dialog[open]' selector, BUT it should still be possible to use nesting for the @starting-style if you segregate the pseudo-element reference using the combine '&' operator for both cases. That way, you can independently maintain the selector for the parent context, like this:
    dialog[open] {
    &::backdrop {
    opacity: .75;
    }
    @starting-style {
    &::backdrop {
    opacity: 1;
    }
    }
    }

  • @tim-pn2fq
    @tim-pn2fq 3 หลายเดือนก่อน +3

    At 13:10, can somebody tell me why translate is animating even though we are only specifying transition-property display and opacity?

    • @tim-pn2fq
      @tim-pn2fq 3 หลายเดือนก่อน +3

      Edit: it looks like transition-property takes a comma separated list, and has an initial value of 'all'

    • @stefanjudis
      @stefanjudis 3 หลายเดือนก่อน

      @@tim-pn2fq I was wondering the same. Thanks for digging this up. :)

  • @MaxWeir
    @MaxWeir 3 หลายเดือนก่อน

    Perfect timing, we recently converted to dialogue for all our modals, this will be a nice upgrade 🙂
    I was asked by our lead dev to convert our off-canvas to a dialogue as well, I however think this is not the appropriate use case and may cause some usability issues?
    AlsoI noticed your link in the desc. isn't formatted correctly - the query string isn't part of the link anymore.

  • @you_cant_see_me_3000
    @you_cant_see_me_3000 3 หลายเดือนก่อน +33

    Today is a good day! I felt it in my bones when I woke up this morning!

  • @Say_whaaaaat
    @Say_whaaaaat 3 หลายเดือนก่อน

    Getting ready for a bunch of fade in sites now

  • @JohnFarrellDev
    @JohnFarrellDev 3 หลายเดือนก่อน

    Whoooa, bought in framer motion to achieve this for a big project before.

  • @legostud
    @legostud 3 หลายเดือนก่อน

    Key frames are also global so be careful what you call them to prevent accidental overrides.

  • @Pukmeister0
    @Pukmeister0 3 หลายเดือนก่อน

    Holy hell, thank you so much for this

  • @backup_hdd
    @backup_hdd 3 หลายเดือนก่อน +1

    wait, why does translate animate despite not being mentioned in transition-property? and what, you can define transition-properties without a comma in between? :o

  • @deadlyecho
    @deadlyecho 3 หลายเดือนก่อน

    Wow that is so powerfull and will make things alot easier

  • @hefalump56
    @hefalump56 26 วันที่ผ่านมา

    Does something like this mean we will be able to create multi-level menus with just CSS and HTML without relying on JavaScript? Love your videos Kevin and I am learning a lot about modern CSS. Currently working it into my designs and finding it solves a lot of issues I have had in the past.

  • @nazmulalok9404
    @nazmulalok9404 3 หลายเดือนก่อน

    So glad to see this, But I am wondering how can I use in a faq using details & summary, Thank you so much Kevin.

  • @coffeemakir1977
    @coffeemakir1977 3 หลายเดือนก่อน

    If they fix margin-top my bucket list will be complete

  • @graysonpeddie
    @graysonpeddie 3 หลายเดือนก่อน

    starting-style... Hopefully Firefox will support that in the future. Firefox seems already behind compared to Chromium-based browsers...

  • @lronmate
    @lronmate 3 หลายเดือนก่อน

    Miracles do happen 😮

  • @hitmusicworldwide
    @hitmusicworldwide 3 หลายเดือนก่อน

    Claude Opus just did this for me to create luminous slide up price cards last week

  • @_hepl
    @_hepl 3 หลายเดือนก่อน

    Oh gosh! Thanks, finally!

  • @titusayyasamy3035
    @titusayyasamy3035 3 หลายเดือนก่อน

    Dialog with transition, good. but you forgot to show us button onclick method by the way 🙂

  • @koreappinesmusic
    @koreappinesmusic 3 หลายเดือนก่อน

    Love your Content, Thank you.

  • @marksyzm
    @marksyzm 3 หลายเดือนก่อน

    I used to use delay of N seconds and a 0 second animation on the display property to get around this. I guess this method is somewhat more straightforward but the starting-style syntax looks a bit awkward. I’m sure I’ll get over it.

    • @marksyzm
      @marksyzm 3 หลายเดือนก่อน

      Nice to have a simple version of from…to like in the animation key frame syntax though with “starting-style”!

  • @benson6158
    @benson6158 3 หลายเดือนก่อน

    Oh this is new?
    I’m just getting into really learning web development (I come from RF test automation) and used this in my first little project. Assumed it was just the normal way to do this.

  • @antonio_carvalho
    @antonio_carvalho 3 หลายเดือนก่อน

    This is exactly what I needed, but it isn't animating when I close() a dialog on Safari (v 17.5), not even in the example on the "transition-behavior" website on MDN.

  • @XCanG
    @XCanG 3 หลายเดือนก่อน +1

    Will it work in this case?
    dialog {
    ...
    &[open] {
    ...
    &::backdrop { ... }
    @starting-style { /* dialog starting styles */ }
    @starting-style &::backdrop { /* dialog backdrop styles */ }
    }
    &::backdrop { ... }
    }

  • @l1f3l3s2
    @l1f3l3s2 3 หลายเดือนก่อน

    Can you make a roadmap of your videos/playlist to learn CSS?

  • @HaseebXorstack
    @HaseebXorstack 3 หลายเดือนก่อน

    How to do an Expanding animation for DISPLAY like the same as opacity?
    Like the `Display: none` element will show like a Stage curtain falls when it is given `Display: block` and vice versa

  • @markshall94
    @markshall94 3 หลายเดือนก่อน

    @16:36 was showing as not working because the properties in `transition-property` need to be comma-separated

  • @deatho0ne587
    @deatho0ne587 3 หลายเดือนก่อน

    Really wish legacy code bases could use this and modal/pop-up from the newer HTML stuff.

  • @fernandobadin3351
    @fernandobadin3351 3 หลายเดือนก่อน +1

    tried to find this on his codepen, couldn't find it!

  • @RonaldGrootJebbink
    @RonaldGrootJebbink 3 หลายเดือนก่อน

    Finally! Also great background news with how it works. I have a question about multiple dialogs. Do you know if it is possible to only use one ::backdrop with a color instead of all. I want the functionality to open two dialogs at the same time, but because the ::backdrop is stacking, the website beneath is getting more and more darker. Just curious if you know what I mean and if you have a creative solution to this :).

  • @typicalyorkshirebloke
    @typicalyorkshirebloke 3 หลายเดือนก่อน +2

    If I was trying to implement this into a typical navbar then, where clicking the hamburger icon shows or hides the links in the navbar, would this still work this way? Instead of opening with one element and having to click another element to hide it again. Appreciate the videos always!

  • @lucadetomi9269
    @lucadetomi9269 3 หลายเดือนก่อน

    Please, how to combine this technique with your solution for accordions made using grid-layouts and transitioning from 0fr to 1fr?

  • @jonmayer
    @jonmayer 3 หลายเดือนก่อน

    About flippin' time!

  • @Kurenquilan
    @Kurenquilan 3 หลายเดือนก่อน

    position: relative > position: fixed?

  • @sandwiched
    @sandwiched 2 หลายเดือนก่อน

    How come the `translate` property was transitioning without the `transition-property` list having it in there?

  • @stephaniepeters2590
    @stephaniepeters2590 3 หลายเดือนก่อน

    So, the translate animated, but it was not one of the transision-properties... or was I missing smomething? Off to try this out now, hope FF and Safari hurry up with this :D

  • @dj10schannel
    @dj10schannel 3 หลายเดือนก่อน

    Hmmm 🤔 never thought this would be added lol

  • @kill_switch_101
    @kill_switch_101 3 หลายเดือนก่อน

    tnx a lot

  • @MattNeemtEenHapje
    @MattNeemtEenHapje 3 หลายเดือนก่อน

    Why didn’t “translate” have to be added in your “transition-property” list but still got animated? Are there more properties that always transition?

  • @Tony.Nguyen137
    @Tony.Nguyen137 3 หลายเดือนก่อน

    When I do transition on visibility, from visibility: visible to visibility:hidden, the transition duration acts as delay, the state change happens after the duration time, but on the other hand, transitioning from visibility:hidden to visibility:visible happens immediately. How comes 😅

  • @cagdasucar3932
    @cagdasucar3932 3 หลายเดือนก่อน

    It's still not available as baseline. I want to know when it is available. This feels like false advertisement.

  • @jerondiovis6128
    @jerondiovis6128 2 หลายเดือนก่อน

    keyframes example doesn't work. I'm literally copying this one-to-one, and It just doesn't. Chrome, FF, Safari, all latest versions - it doesn't work.
    What's the trick here?

  • @BenjaminKamradt
    @BenjaminKamradt 3 หลายเดือนก่อน

    Seems like it wont work in a bunch of Browsers like Safari or Firefox when I take a look at caniuse and "allow-discrete" or "@starting-style". So we can finaly transition between display none and display block but we have to wait a long time until we can use it on production systems.

  • @pendaco
    @pendaco 3 หลายเดือนก่อน

    So we could make a truly css only accordeon or animated tab group now?

  • @chrisauret3785
    @chrisauret3785 3 หลายเดือนก่อน

    It's been 2 weeks and I still can't figure out how to make a card flip after a Dialog opens.. every example is with :hover

  • @backup_hdd
    @backup_hdd 3 หลายเดือนก่อน

    ah yes, "yes", my favorite animation type

  • @whatamiwitnessing1003
    @whatamiwitnessing1003 2 หลายเดือนก่อน

    How would you implement this on a multi row header to hide certain rows? I cant figure it out.

  • @afrayedknot81
    @afrayedknot81 3 หลายเดือนก่อน +1

    Cool stuff. When will these be supported by most modern web browsers?

    • @trappedcat3615
      @trappedcat3615 3 หลายเดือนก่อน +1

      I guess most would only require Chrome and Safari?

  • @witchestify
    @witchestify 3 หลายเดือนก่อน

    all this time im using the simple line of css that i found myself. by using pointer events none and opacity. then transition it

  • @Jedediahiah
    @Jedediahiah 3 หลายเดือนก่อน

    Great video as always! Curious as to why the translate: 0 -25vh; animates without being specified as a transition-property?

  • @BradenKelley
    @BradenKelley 3 หลายเดือนก่อน

    Why is the translate transitioning even though it’s not listed in transition-property?

  • @barmolino
    @barmolino 3 หลายเดือนก่อน

    I did similar but with rotating

  • @tommysmith5479
    @tommysmith5479 3 หลายเดือนก่อน

    what is the [open]? never seen that before.

  • @felipebarth
    @felipebarth 3 หลายเดือนก่อน

    How can I apply that to the DETAILS tag once what is hidden automatically is everything that isn't SUMMARY? I mean, there is no css definition to them (at least from what I inspect in devTools)

  • @asatyammis
    @asatyammis 2 หลายเดือนก่อน

    Imagine fighting a junior over the non-transitionable nature of display property, and he pulls up this trick.