It's a great way to make conditional styles without having to use JavaScript; however, having used JS for years to make theme color and icon sets that rely on CSS properties, I'm not sure I particularly like this method. I feel like you have to smear a lot of logic across your CSS whereas with JS you can reduce your theme to a data structure and just have a simple function to setup all the CSS variables based on that…
CSS now has an if() conditional function
11–20 of 245 posts
Re: CSS now has an if() conditional function
#12Not supported in Firefox and Safari. Also it seems most people forget that the more bloated the web platform is, the more resources are needed to develop and maintain a web browser engine.. Chromium is open-source, but it's already expensive to maintain a fork or even rebuild it..
[flagged]
That's pretty simple - Google has poured tons of money into Chrome and Mozilla. Google is not a charity so this was a strategic investment.
> You should go over to the CSS working group and let them know
That wouldn't work, money is what ultimately matters there.
Re: CSS now has an if() conditional function
#13It's a great way to make conditional styles without having to use JavaScript; however, having used JS for years to make theme color and icon sets that rely on CSS properties, I'm not sure I particularly like this method. I feel like you have to smear a lot of logic across your CSS whereas with JS you can reduce your theme to a data structure and just have a simple function to setup all the CSS variables based on that…
Re: CSS now has an if() conditional function
#14If we could do it over, knowing that we'd eventually get to this point, would https://en.wikipedia.org/wiki/JavaScript_Style_Sheets have been the better path?
Re: CSS now has an if() conditional function
#15Earlier quoted context omitted.
[flagged]
> How did this happen? That's pretty simple - Google has poured tons of money into Chrome and Mozilla. Google is not a charity so this was a strategic investment. > You should go over to the CSS working group and let them know That wouldn't work, money is what ultimately matters there.
Re: CSS now has an if() conditional function
#16If we could do it over, knowing that we'd eventually get to this point, would https://en.wikipedia.org/wiki/JavaScript_Style_Sheets have been the better path?
If I had a time machine I would go back and ensure that DSSSL ( https://en.wikipedia.org/wiki/Document_Style_Semantics_and_S... ) was the standard that got up.
Re: CSS now has an if() conditional function
#17If we could do it over, knowing that we'd eventually get to this point, would https://en.wikipedia.org/wiki/JavaScript_Style_Sheets have been the better path?
If I had a time machine I would go back and ensure that DSSSL ( https://en.wikipedia.org/wiki/Document_Style_Semantics_and_S... ) was the standard that got up.
Although I feel like we've already explored this with XSL. The XML syntax was perhaps too much to swallow.
Re: CSS now has an if() conditional function
#18Far from being ready when only one major browser supports it. If you want this, you should vote for it to be focused on for interop-2026 https://github.com/web-platform-tests/interop/issues Right now, the leading CSS proposals are `@container style()`, `corner-shape` and `break-after` https://foolip.github.io/interop-reactions/
Re: CSS now has an if() conditional function
#19Earlier quoted context omitted.
> How did this happen? That's pretty simple - Google has poured tons of money into Chrome and Mozilla. Google is not a charity so this was a strategic investment. > You should go over to the CSS working group and let them know That wouldn't work, money is what ultimately matters there.
[flagged]
Re: CSS now has an if() conditional function
#20Earlier quoted context omitted.
[flagged]
lol. What other browser vendors? Whatwg is just google is a trench coat. Edge is chrome. Firefox is funded by Google. So I guess apple who's main contribution is being years behind and having half their stuff be broken
If Google controls everything, why is if() only supported on 59% traffic? Do you think any serious company will let their site break on 40% of clients? Do you think Apple's opinion is unimportant?