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.
CSS now has an if() conditional function
91–100 of 245 posts
Re: CSS now has an if() conditional function
#92Not 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..
They just need to start deprecating and removing old features. They had no issues with XSLT removal even when some major sites like the library of congress used it. So the excuse of backward compatability has already proven to be a lie.
Re: CSS now has an if() conditional function
#93I'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.
Re: CSS now has an if() conditional function
#94If 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
#95Can it already vertically and horizontally center unknown-beforehand-length multi-line text in a single html element, just like non-CSS table cells could already in 1995?
Non-CSS table cells have never been able to do that – you need a wrapping at minimum for browsers to render it how you want, a for it to be valid HTML, and comes along for the ride as well as an implied element. So that’s four elements if you want to centre vertically with or . If you wait until the year 2000, then you can get that down to three elements by switching from HTML to XHTML because is no longer implied in XHTML.
CSS, on the other hand, has been able to do what you want since 1998 (CSS 2) with only two elements:
.
html,
body {
height: 100%;
}
.outer {
display: table;
width: 100%;
height: 100%;
}
.inner {
display: table-cell;
vertical-align: middle;
text-align: center;
}
Test
Test
Test
Test
Test
Test
(I’m using a element here for clarity, but you can do the same thing with style attributes.)Re: CSS now has an if() conditional function
#96I guess we can now write Excel in CSS.
At the same time over a period of years the web approach is to make the whole thing more like a bunch of interlocked Excels, more so than it already was before.
Does that mean any resulting disadvantage during following years is intentional? Any more than huge orgs grew to depend on Excel, one physical desktop at a time since that was the only thing in common among all those diverse desk owners that would do the job, plus it was the first thing to come along to fill that niche.
Re: CSS now has an if() conditional function
#97Now we just need a while loop to make it turing complete.
Re: CSS now has an if() conditional function
#98It'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
#99Earlier quoted context omitted.
It's in the draft spec for the CSS Values and Units Module Level 5 ( https://drafts.csswg.org/css-values-5/#if-notation ) I don't see Mozilla's or WebKit's positions anywhere, so this is a Chromium-only feature for now.
Curiously, Can I Use says: > All major browser engines are working on implementing this spec. However their official positions are absent: https://github.com/mozilla/standards-positions/issues/1167 https://github.com/WebKit/standards-positions/issues/453 And Firefox’s bug for implementing it has no activity: https://bugzilla.mozilla.org/show_bug.cgi?id=1981485 And Can I Use’s underlying data doesn’t have this note: h…