5 ms·
As a developer I hope that CSS would share a similar fate sometime in the not too distant future. It’s freaking hideous, doesn’t work as it should and in order
by elorant 13y ago
As a developer I hope that CSS would share a similar fate sometime in the not too distant future. It’s freaking hideous, doesn’t work as it should and in order to build any decent modern site you end up writing something like 5,000 LoC. Nine out of ten times I want to do something with CSS I prefer doing it with JavaScript.
- thoughtpalette 13y ago"Nine out of ten times I want to do something with CSS I prefer doing it with JavaScript" You're doing something wrong then.
- debt 13y agocenter a div both vertically and horizontally to the viewport; also it should stay center when resized.
- thoughtpalette 13y agoAbsolute Horizontal And Vertical Centering In CSS http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/ http://coding.smashingmagazine.com/2013/08/09/absolute-horiz...
- debt 13y agoTruth. The div would need a variable height though which would change the design.
- proexploit 13y agoThe page linked includes techniques for both variable height content (e.g. translate -50%) and fixed content.
- deleted 13y ago[deleted]
- ptx 13y agoAlthough this used to be a problem with CSS, it has been fixed in modern browsers: http://philipwalton.github.io/solved-by-flexbox/demos/vertical-centering/ http://philipwalton.github.io/solved-by-flexbox/demos/vertic...
- pjmlp 13y agoNow make it work across all browsers and operating systems required by your customer.
- elclanrs 13y agoYou can use viewport units in modern browsers. See here http://caniuse.com/viewport-units http://caniuse.com/viewport-units
- jsnk 13y agoUse Sass. Thank me later.
- bluetidepro 13y agoOr LESS! I personally prefer that over Sass.
- jbeja 13y agoOr Stylus.
- minimaxir 13y agoWhen you have modern CSS frameworks like Bootstrap and Foundation available, the CSS aspect of a website is arguably one of the least complicated aspects of front-end development. (and better for the users instead of using JavaScript) Even animations are easier to do in CSS due to CSS3 animation libraries.
- sp332 13y agoBootstrap is javascript.
- deleted 13y ago[deleted]
- mintplant 13y agoBootstrap contains some JavaScript for certain modules, but the majority is CSS (well, Less).
- sp332 13y agoOk, cool. But Less is also javascript!
- minimaxir 13y agoWhat the client sees is CSS, and that's the important part.
- sp332 13y agoThe important part for elorant (and me) is that CSS is awful to work with. And everyone in this thread is proving it by pointing out that you should use some kind of translation layer instead of actually touching it.
- pyre 13y agoWell, there's two things at play here. The complexity of the CSS model in the browser (plus all the browser-specific quirks) and the CSS syntax. Less only solves the CSS syntax issue. My reading of this thread is that it was started based on the complexity of dealing with CSS in the browser rather than dealing with the CSS syntax.
- ChikkaChiChi 13y agoCan you provide any examples where using JS would be preferable to you? Maybe we can help?
- SDGT 13y ago> I want to do something with CSS I prefer doing it with JavaScript. So now you're you're still writing css, but in JS files instead? Not taking advantage of shorthand transitions, keyframe animations, or :before/:after stylings. SASS/LESS helps a lot (not to mention straight up frameworks like Bootstrap or Foundation), but what you're doing is even harder to maintain than structured CSS files.
- crimsonalucard 13y agoI agree that something is wrong with CSS. When you have to resort to hacks when making columns and vertically centering things... you know something is wrong.
- jbeja 13y agoMaybe vendors and browser fragmentation is what you are referring to?
- anentropic 13y agono, CSS itself is a bit shit, that's why LESS and SASS came along
- jbeja 13y agoI wasn't talking about transpilers, i was referring to vendors support for every major browser.
- crimsonalucard 13y agoDoes LESS or SASS fix the things I mentioned above?
- _a 13y agono :(
- johnjlocke 13y agoLESS and Sass compile to CSS.