Live data from Hacker News

Absolute Horizontal And Vertical Centering In CSS

coding.smashingmagazine.com

61–62 of 62 posts

Re: Absolute Horizontal And Vertical Centering In CSS

#61

I'm curious why there isn't something like TypeScript or Coffeescript for CSS? I'm aware of LESS and SASS but to my knowledge they don't go as far as their JavaScript complements in adding future-looking functionality. Is it simply not possible to add CSS grid or flexbox (or both!) support to LESS and have it compile down to plain ol' CSS?

Not sure what you mean by "future-looking functionality". I don't know anything about TypeScript but CoffeeScript is just an opinionated way to generate JavaScript. Isn't that what both LESS and SASS do for CSS? Regarding grid or flexbox, that is ultimately a design decision/preference of the architect. So using your example, if SASS inherently used grid that would be like CoffeeScript introducing MVC into your proje…

TypeScript adds some features planned for Javascript such as classes with inheritance and modules. The thinking is that when these features become standardized your TypeScript code will be valid Javascript. (Or at least as far as those features are concerned.) So in the same vein, why doesn't SASS provide the next generation of CSS functionality? That is, you use the proposed syntax for CSS grids and it transforms that into whatever mess is necessary to emulate it in today's CSS. Later when CSS grid support is available no translation is necessary.

I suppose the answer is because it can't do so in CSS alone and that emulating CSS Grid would require CSS, DOM, and Javascript to be emitted from the compiled SASS script. It would be neat if someone who knew more could confirm my suspicion.

I'm not sure I follow your example regarding CoffeeScript and MVC.

Re: Absolute Horizontal And Vertical Centering In CSS

#62
post #6

The fact that this is an interesting article is a huge indictment of CSS. It was developed for a different, simpler use case, and it's obviously the wrong abstraction at this point. Too bad it's entrenched.

I've been saying this of JS/HTML/CSS for years, but people seem to suffer from severe stockholm syndrome.

Name another software runtime that even partially works as well cross-platform. Or another runtime that has the notion of multiple competing implementors.
Post reply on HN