Пропустить навигацию
soon: CSS only sticky scroll hide/reveal 🧑‍🍳
0:00 / 0:20

soon: CSS only sticky scroll hide/reveal 🧑‍🍳

jhey ʕ•ᴥ•ʔ

@jh3yy147 тыс. подписчиков

Открыть в X
553 отметки «Нравится»СкачатьОригинальный пост

66 423 просмотра

soon: CSS only sticky scroll hide/reveal 🧑‍🍳 .atc { position: fixed; bottom: 0; transition: translate 0.26s cubic-bezier(.55,0,.67,1.25); /* hide on scroll down */ @​container scroll-state(scrolled: bottom) { translate: 0 100%; transition-delay: 0.5s; } }

13 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Victor Rivas

    @shipwithvictor

    Top top!!

    1 отметка «Нравится»

  • Фото профиля jhey ʕ•ᴥ•ʔ

    @jh3yy

    @readytorelease it’s at the bottom though 🥁😅

    1 отметка «Нравится»

  • Фото профиля Jan Nicklas

    @jantimon

    wow - is it also possible to build a scrolled bottom once?

    1 отметка «Нравится»

  • Фото профиля jhey ʕ•ᴥ•ʔ

    @jh3yy

    like a tuck away and forget after scrolling from the top but towards the bottom? you could do a scroll animation that triggers a translation at a certain point that then wouldn’t trigger again until scrolling back up

    2 отметки «Нравится»

  • Фото профиля Michaël

    @mic_gallego

    One current limitation is the inability to specify an offset. For instance, in our case we would like to hide a header after scrolling for a given amount. Having a way to define scroll-state(scrolled: bottom by 100px) for instance would be nice! Is this something being planned?

    1 отметка «Нравится»

  • Фото профиля jhey ʕ•ᴥ•ʔ

    @jh3yy

    yeah, agreed 💯 it kinda feels like you'd want something a bit like scroll-margin/padding-top to have an effect on the scroll-state trigger 🤔

  • Фото профиля Michaël

    @mic_gallego

    Exactly. Using scroll-margin/padding was actually my first intuition, but this did not work!

    1 отметка «Нравится»

  • Фото профиля ᴋᴏᴠᴀʀ

    @stevenkovar

    Is it fully supported finally?

    1 отметка «Нравится»

  • Фото профиля Fabrizio Calderan

    @fcalderan

    You may achieve a similar behaviour using custom properties and style queries

    1 отметка «Нравится»

  • Фото профиля jhey ʕ•ᴥ•ʔ

    @jh3yy

    find this one unreliable unfortunately, it’s easy to get into a state where it doesn’t appear when you want it to

  • Фото профиля gumbo701

    @gumbo701

    Css is beautiful

  • Фото профиля Human

    @mogzhiza

    Is it possible to have a sticky block hide/reveal as you scroll, rather than through a transition animation?

  • Фото профиля gokhan

    @gkurttech

    Cool. I think it's somewhat possible with scroll/view states already.