CSS Custom Functions are coming
11–20 of 90 posts
Re: CSS Custom Functions are coming
#12Thanks. Looks hideous. @function --light-dark(--light, --dark) { result: var(--light); @media (prefers-color-scheme: dark) { result: var(--dark); } }
If you're going to add imperative programming to CSS, just do it already. Hacking in conditionals in this way feels like a bad joke.
Re: CSS Custom Functions are coming
#13Why do we allow Google to singlehandedly keep pumping garbage into the web ecosystem? Do they own W3C?
Re: CSS Custom Functions are coming
#14Why do we allow Google to singlehandedly keep pumping garbage into the web ecosystem? Do they own W3C?
Re: CSS Custom Functions are coming
#15Thanks. Looks hideous. @function --light-dark(--light, --dark) { result: var(--light); @media (prefers-color-scheme: dark) { result: var(--dark); } }
Yeah, I couldn't believe it at first. If you're going to add imperative programming to CSS, just do it already. Hacking in conditionals in this way feels like a bad joke.
Re: CSS Custom Functions are coming
#16Re: CSS Custom Functions are coming
#17The comments here indicate that the article doesn’t do much to explain what this does or why you’d want it, but basically this gives you a way to reuse blocks of styles without needing to resort to e.g. utility classes or other hacks that get around specificity issues. The syntax doesn’t help explain that.
Shame about the syntax, but I’m used to it at this point.
Re: CSS Custom Functions are coming
#18Re: CSS Custom Functions are coming
#19Why do we allow Google to singlehandedly keep pumping garbage into the web ecosystem? Do they own W3C?
This makes perfect sense if you think about it, because the browser makers ultimately decide what goes into the browser. If the W3C was "in charge" and tried to make Google (or another browser maker) do anything, Google could simply ignore them. That system wouldn't last.
It has to work this way ... and Google (along with Apple, Microsoft, etc.) have decided this syntax is best for them (and possibly their users).