CSS now has an if() conditional function
211–220 of 245 posts
Re: CSS now has an if() conditional function
#212just a meta note that the submitter, aanthonymax, likely only posted this to launder karma to avoid being shadowed for spamming their github project. a quick look at their post history shows that they only post links to their github project and then occasionally extremely low effort random mdn or other useless links to try to balance our their account. their previous account was shadowed for basically the same thing
Re: CSS now has an if() conditional function
#213Earlier quoted context omitted.
Conditional expressions are declarative. For example, every template language worth its salt has conditionals. A programming (i.e Turing complete) language requires recursion or a construct of equal power.
There is no recursive program that can't also be created by adding in more conditionals. It's turtles the whole way down.
Re: CSS now has an if() conditional function
#214Earlier quoted context omitted.
> every declarative language becomes a programming language. Overly pessimistic, lots of non-programming languages remain non-programming languages. Just because one of the most widely used declarative languages start adding conditionals doesn't mean the whole world is turning upside down... > The distinction between code, config and data is being erased. As as lisp programmer, I love it. Get rid of treating things d…
If only Lisp had better presense in modern code editors. Emacs is not enough, especially on Windows where it is super slow. I think this is what actually stops newcomers to start with Lisp and not Python
Re: CSS now has an if() conditional function
#215If 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
#216Give 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
#217Give 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.
It's not that the presentation layer need conditionals, it's that the layers under it have grown full of hacks that need more hacks to work around them, because the web was designed to grow documents, not programs.
If the web had been designed for applications in the first place, the presentation layer probably wouldn't need conditionals at all.
Re: CSS now has an if() conditional function
#218I'm not sure turning CSS into a full blown language is a good idea. With all the cascading in place, it is already a bit hard to determine why certain styles are applied. Now with this, we will be spending more brain cells debugging CSS issues.
On the contrary, a lot of the reason CSS is confusing is because it's full of insane hacks people have to do to get the behaviour they want. A straight-up if statement is much simpler than many of the horrors I've seen.
CSS is confusing because the vast majority of web developers never learned it properly. Many developers won't learn any "new" CSS (like CSS Grid which shipped in all browsers in 2017) beyond the hacks they learned in the '90s and early 2000's.
That's not the fault of CSS.
Re: CSS now has an if() conditional function
#219Earlier quoted context omitted.
not as much as you would think, the if statements don't really affect the css crimes scene because pretty much everything was already possible before
But then why was it added?
Re: CSS now has an if() conditional function
#220just a meta note that the submitter, aanthonymax, likely only posted this to launder karma to avoid being shadowed for spamming their github project. a quick look at their post history shows that they only post links to their github project and then occasionally extremely low effort random mdn or other useless links to try to balance our their account. their previous account was shadowed for basically the same thing
This stuff makes me paranoid about posting my projects here and everywhere. Don't want to be seen as advertising my code...