Live data from Hacker News

CSS Custom Functions are coming

bram.us

51–60 of 90 posts

Re: CSS Custom Functions are coming

#51

This 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.

Either it will be popular enough that other browsers will implement the open standard, or it will not be popular and no one will implement it in other browsers and few sites will use it. 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.

isn't opera just chrome now? that would obviously let them keep up

Re: CSS Custom Functions are coming

#53
post #33
post #4

Thanks. Looks hideous. @function --light-dark(--light, --dark) { result: var(--light); @media (prefers-color-scheme: dark) { result: var(--dark); } }

Looks decent to me, I understand they have to stay within the normal look of CSS. That function, other than nesting, could every well be parsed by a 20-year-old parser.

[deleted]

Re: CSS Custom Functions are coming

#54

I don't know how the web does it. There are so many cool things being added. How do they keep the spec manageable? What if someone wanted to build a compliant web browser from the ground up?

That's not a concern of the people writing the spec, but Ladybird is making an admirable go of it. You can shed a lot of complexity by only focusing on the modern standards, and Ladybird has helped fix several bugs in the standards themselves.

Re: CSS Custom Functions are coming

#55

This 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.

I agree Google has too much market share and sway over plenty of browser features. 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…

At this point the W3C is basically under control of Google anyway.

Re: CSS Custom Functions are coming

#56

Earlier quoted context omitted.

I agree Google has too much market share and sway over plenty of browser features. 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…

At this point the W3C is basically under control of Google anyway.

Non sense. Read the reply: this is a feature that is coming to all major browsers

Re: CSS Custom Functions are coming

#57

Earlier quoted context omitted.

At this point the W3C is basically under control of Google anyway.

Non sense. Read the reply: this is a feature that is coming to all major browsers

coming to all major browsers

Chrome, Chrome, Chrome, and Chrome?

Re: CSS Custom Functions are coming

#59
post #43
post #17

This 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…

Can you expand with some examples of pressing use cases? To me, great complexity should bring even greater utility. I have no use for this, and I’m not sure who it’s for. Can we get rid of tailwind? Polyfills? Any UI libs?

It’s hard to explain because most web development solves these problems with CSS in JS with JS runtimes. One use case I have is what I call “responsive variants”; basically a way to apply a variant’s styles on a component instance (speaking abstractly here; could be react, vue, whatever) within any arbitrary styling context without duplicating CSS or resorting to something that applies CSS with a JS runtime.

I work on a web development platform for a living and this is the sort of thing that would be good for us; if you don’t want your website to wait for JS to render content correctly and you want to keep your CSS bundle small, there aren’t many good options.

Re: CSS Custom Functions are coming

#60

This 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.

This idea has traction with other browser vendors too, FWIW. They just don’t have godlike budgets, unfortunately.
Post reply on HN