Live data from Hacker News

CSS now has an if() conditional function

caniuse.com

41–50 of 245 posts

Re: CSS now has an if() conditional function

#42
Give it enough time, every declarative language becomes a programming language. This is happening with all config files, markup languages, data formats.

The distinction between code, config and data is being erased. Everything is a soup now. Data is application, configuration is code. Code is an intermediate, volatile thing that is generated on the fly and executed in the temporary lambda containers.

Re: CSS now has an if() conditional function

#44
post #42

Give it enough time, every declarative language becomes a programming language. This is happening with all config files, markup languages, data formats. The distinction between code, config and data is being erased. Everything is a soup now. Data is application, configuration is code. Code is an intermediate, volatile thing that is generated on the fly and executed in the temporary lambda containers.

We can blame von Neumann (et al) and his infernal architecture, where memory stores both instructions and data.

Re: CSS now has an if() conditional function

#47

Earlier quoted context omitted.

Javascript always suffer from FOUC problem though (Unless it's server side). Although the if() css function seems to just be syntax suger of standard @media query. So it doesn't really add anything to solve existing problems. Edited: It seems it can also be toggled from css variable? So it might actually fix some existing problems.

How hard would it be to have a response header that tells the browser "don't display anything at all until we ask you to from JS when we're ready"? Considering the kinds of crap that have been done with headers...

Many sites do something like that in practice. The problem is the extra 500ms of parse+eval time for your JS bundle influences user behavior a lot on the margin, so it’s better to not force the user to wait.

Re: CSS now has an if() conditional function

#48

Earlier quoted context omitted.

Javascript always suffer from FOUC problem though (Unless it's server side). Although the if() css function seems to just be syntax suger of standard @media query. So it doesn't really add anything to solve existing problems. Edited: It seems it can also be toggled from css variable? So it might actually fix some existing problems.

How hard would it be to have a response header that tells the browser "don't display anything at all until we ask you to from JS when we're ready"? Considering the kinds of crap that have been done with headers...

Practically only cordova does these for now. But it's a native app so of course it can do whatever it want.

Re: CSS now has an if() conditional function

#49

Earlier quoted context omitted.

Javascript always suffer from FOUC problem though (Unless it's server side). Although the if() css function seems to just be syntax suger of standard @media query. So it doesn't really add anything to solve existing problems. Edited: It seems it can also be toggled from css variable? So it might actually fix some existing problems.

How hard would it be to have a response header that tells the browser "don't display anything at all until we ask you to from JS when we're ready"? Considering the kinds of crap that have been done with headers...

Would it be enough to have hidden using an inline style in the initial html response and when everything is loaded, one would remove the style using javascript?

Re: CSS now has an if() conditional function

#50

As long as css remains "so fast it's free" then I'm mostly happy with that - I use css without thinking about optimisations, and I like it like that!

You can certainly write slow CSS, and people do :-) JavaScript typically takes up more of the CPU time overall, though.
Post reply on HN