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 IconComment Icon
1,642 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.

12 comments #

118likes
35reposts
  • 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
  • Chris
  • kopper
  • Will Browar ????????‍????
  • McNeely
  • Honza Javorek
  • Tyler Sticka
  • Axel Leroy
  • Bram
  • Toby Evans
  • Reuben Walker
  • Jan
  • Daniel Schwarz
  • Aleca
  • Oliver Andrich
  • Firefox for Web Developers
  • Matthias Vogel
  • Олексій
  • Jan Andrle
  • Orde Saunders ????
  • bizzl / fourteen bit

Join the conversation on

#CSS `@custom-media` available behind a flag in Firefox Nightly ???????? Lovely syntax, just lovely. nerdy.dev/custom-media
Image
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

@argyleink is this inspired by CSS custom properties? It looks like what one might expect a media version of a variable to be

McNeelyMcNeely
Yea, this is big time. Anything moving us along for cleaner CSS documents is a win.
Kevin McLaughlinKevin McLaughlin
Custom media queries will clean up my CSS. Finally.
Rodrigo DiasRodrigo Dias

@argyleink

I'd love it if we could land either CSS custom media or style queries (so we can accomplish the same thing) cross browser.

Any clue if FF is working on style queries? They're the only one that doesn't support that.

cc @firefox @firefoxnightly

Mike Herchels disembodied headMike Herchels disembodied head