RSS FeedTwitterMastodonBlueskyShare IconHeart IconGithub IconArrow IconClock IconGUI Challenges IconHome IconNote IconBlog IconCSS IconJS IconHTML IconShows IconOpen Source Software IconSpeaking IconTools IconShuffle IconNext IconPrevious IconCalendar IconCalendar Edit IconNotebook IconObservable Notebooks IconSlash IconGoogle G Icon
My google avatar.
devrel@google
notecss

Advanced attr() in Chrome 133. Opening new ways to integrate with CSS from your HTML:

<li scroll-snap="start"></li>
<li scroll-snap="center"></li>
[scroll-snap] {
  scroll-snap-align: attr(scroll-snap type(start | center | end));
}

Try it & learn more from Bramus @ Chrome Developers

6 mentions #

77likes
21reposts
  • Roni Laukkarinen
  • ffoodd
  • Veikko Eeva
  • Jon Henshaw
  • blokche
  • Emanuel Saramago
  • Ryan Mulligan
  • Doug Parker
  • Gustav Hansen
  • That HTML Blog & The Spicy Web
  • Daniel
  • mr lochlan
  • GENKI
  • Jacob Marshall
  • Sangeeth Sudheer
  • SanityPress
  • @joellesenne.dev
  • Zéfling
  • leventef
  • Jack Iakovenko

Join the conversation on

Would scroll-snap-align: attr(scroll-snap type("start | center | end")) be valid? That seems more equivalent to the first example.
Jason ChristaJason Christa

@argyleink This CSS feature is really really cool! Though inventing custom attribute names without `data-` is something we want to avoid generally

JelmerJelmer
Is this ???? Tailwind?

@argyleink Uuuu thats a nice one! New attr() features are super powerful, and I am just waiting for new patterns we will explore soon.

https://mastodon.social/@pawelgrzybek/113843980110588700

Paweł Grzybek (@pawelgrzybek@mastodon.social)
Paweł GrzybekPaweł Grzybek
This is awesome!
coding at nightcoding at night