Thanks. Looks hideous. @function --light-dark(--light, --dark) { result: var(--light); @media (prefers-color-scheme: dark) { result: var(--dark); } }
CSS Custom Functions are coming
41–50 of 90 posts
Re: CSS Custom Functions are coming
#42Re: CSS Custom Functions are coming
#43This is it. This is all I’ve wanted in CSS for the last decade. In fact, I just wanted basic mixins without function-like behavior, but this gets me there. The 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 is…
Re: CSS Custom Functions are coming
#44Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google.
Exactly.
Re: CSS Custom Functions are coming
#45This is exactly the sort of propaganda which encourages making sites that don't work in any browser but Google's. If web developers would just focus on making simple and widely-accessible sites instead of churnful trendchasing, the browser monopoly wouldn't exist. Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. Exactly.
Mozilla has a revenue of like $600M. They should have no problem keeping up with popular w3c standards. Hell, even opera, with only a tiny fraction of users can keep up.
Re: CSS Custom Functions are coming
#46Re: CSS Custom Functions are coming
#47This is exactly the sort of propaganda which encourages making sites that don't work in any browser but Google's. If web developers would just focus on making simple and widely-accessible sites instead of churnful trendchasing, the browser monopoly wouldn't exist. Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. Exactly.
However… CSS features are a W3C specification and are an early stage [1]. It’s a process that vendors draft and agree on and can terminate.
On top of that I wouldn’t characterise improving css with functions isn’t a _churnful trendchasing_. If anything this will improve accessibility because it’ll be easier to manage size, colour, and motion preferences with better abstractions than media queries everywhere.
Re: CSS Custom Functions are coming
#48Oh man, and I thought the current JS status-quo was already full of vulnerabilities and privacy risks. If I had mind-boggling amounts of money, one of the things I would do is start an organization to name and shame and give anti-awards to websites that most abuse javascript and whatever-this-will-be. Or a dang mutual fund: "Like an index fund except we don't support companies with websites that require a ridiculous…
Re: CSS Custom Functions are coming
#49This is exactly the sort of propaganda which encourages making sites that don't work in any browser but Google's. If web developers would just focus on making simple and widely-accessible sites instead of churnful trendchasing, the browser monopoly wouldn't exist. Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. Exactly.
Custom functions have been a huge web developer request for a long, long time and is one of the remaining gaps between standard CSS and Sass/LESS, after variables and nesting shipped. Mixins are next, and they'll be good too.
Not every advancement in the web platform needs to be some kind of conspiracy.
Re: CSS Custom Functions are coming
#50functions in stylesheets? That's nuts. The web is developing in the wrong way.