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 IconYouTube IconEye Icon
185 views · 10 active
A cartoon skull with a hotpink hat on.
atom@argyleink
notecss

@custom-media working behind a flag in Firefox Nightly!

@custom-media --motionOK (prefers-reduced-motion: no-preference);

@media (--motionOK) {
  transition: transform .3s ease;
}

Lovely syntax. Open Props has ~45 ready to go, peep the spec, or visit MDN for more info.

8 comments #

71likes
14reposts
  • David Lapointe Gilbert
  • GENKI
  • Carol McKay (she / her)
  • netop://ウィビ
  • The Doctor
  • Francis Rubio
  • Fronteers
  • Ruby Quail
  • Martin Grubinger
  • Jacob Marshall
  • Roni Rolle Laukkarinen
  • Max
  • Schalk Neethling
  • Kirbee

Join the conversation on

#CSS `@custom-media` available behind a flag in Firefox Nightly ???????? Lovely syntax, just lovely. nerdy.dev/custom-media
Love it. I recently ran into a case where I wished I could use it with `@container` too. There is an open spec issue for `@custom-container`: github.com/w3c/csswg-dr...
Arpit AgrawalArpit Agrawal

@argyleink awesome! Have had a play with it and I like it. Looks like you cannot update with JS? Is that a browser issue or a standards issue? i.e. is it csswg or something in JS land?

bigandybigandy
yes, that would be very useful! Also, would be good to combine all queries e.g. @supports, @container @media in to one combined custom query.
Andrew HudsonAndrew Hudson
Had no idea about this one, this is incredible. So much cleaner!
Josh Davenport-SmithJosh Davenport-Smith

@argyleink Love this. Do you know if they're supposed to respect `@layer`? Both the spec and MDN mention "last" definition winning, but don't know if order like that implicitly includes layers or not.

ChrisChris
Good addition, simplifies media queries.
Rodrigo DiasRodrigo Dias
What the blessings is this!!!!! ❤️ ❤️ ❤️ ❤️
Schalk NeethlingSchalk Neethling