Hacker Newsnew | comments | show | ask | jobs | submit login

I have honestly never heard of anyone not liking CSS before reading this thread, except for maybe people just starting out who don't understand it. I am an experienced front-end developer an agency and I love css when it's enhanced by a dynamic language like sass or stylus. It's quick, powerful, and easy style many elements at once and create beautiful and lightweight custom UI elements. The only thing I don't like is having to work with it cross browser, but that has nothing to do with css as a language.

I studied iOS development for a few months, read a 600 page book on it, and tinkered around with it for a while and found myself begging for CSS. Native custom app interfaces seem backwards to me - the difficult of writing core graphics methods for every bevel, rounded corner, gradient etc has a lot of developers just using cut images for everything. Disclaimer, I'm way way more experienced with css than i am with core graphics - just my impressions.




> I have honestly never heard of anyone not liking CSS before reading this thread, except for maybe people just starting out

Really?

CSS is fine until you want to build something specific. The amount of hacks required for even the simplest thing is amazing.

Want that UL to have it's LIs in a grid? Use float. Float was supposed to make text wrap around images, but we use it for the side effect of making block elements behave like inline. It also messes up the height of the UL, since it doesn't really contain any text to be wrapped around. You can fix it most of the time, but it's a hassle, and prone to break.

Want a UL to be on one line and centered? There's a hack for that! And it's completely unintuitive black magic.

Even the simple things like lining up elements with a fixed margin between each other and to the containing element was a great hassle up until just recently when we could finally begin relying on CSS 3 features.

It's a big stupid mess with missing features and features misused.

The basic idea was OK, with the selectors and rules. The execution as was 10 years ago, and to a large degree still is, was horrible.

-----


I often find myself wishing for CSS widgets, so to speak. A reusable component of HTML and CSS that can be inserted without inheriting anything from the parent elements. You can achieve this if you take a lot of care, but it should be a lot easier than it is.

But where CSS really falls apart is in layouts. What is just a simple equation in a native application ends up being a myriad of hacks to get things flowing right in CSS. Javascript comes with the missing pieces, but introduces its own set of problems if you try to rely on it.

> the difficult of writing core graphics methods for every bevel, rounded corner, gradient etc has a lot of developers just using cut images for everything.

On iOS, the QuartzCore framework provides declarative methods for those common style choices (rounded corners, gradients, etc.).

-----


The new CSS3 flexible box layout changes all that. It's incredibly rich and designed to obviate the need for clumsy CSS layout hacks. Check it out if you haven't already... it is the missing piece for app-like layouts for the web. The incredibly complex layouts that can be achieved with minimal CSS and no JS is astounding. Pair this with text-overflow and with ~ 50 lines of CSS and some very basic html you can achieve wonders.

Not only that but it's usable today. Both webkit and gecko have very close implementations with only minor edge cases, none of which are insurmountable.

Not sure about iOS support for the new layout modes.

-----


Non-inheriting CSS widgets are coming with Web Components and the Shadow DOM. http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/i...

Browsers, in fact, already use the shadow DOM to render many of their custom forms. It's just not available programmatically yet.

Layouts aren't completely horrifying if you use a good, responsive grid, although within that grid framework itself there are likely some hacks. But as mentioned -- new CSS layout types are coming!

-----


You really don't seem like you have had to implement a lot of CSS in the context of a spec or design.

-----


You apparently did not read my comment. I mentioned that I am an experienced front end dev working at an agency - I have in fact implemented quite a large amount of css in the context of both specs and designs. Even for personal projects and sites, I do a full design in photoshop then convert to css afterward

-----


Lots of prozac? I'd love to know how you have the patience for this. CSS seems like something invented by a secret cabal trying to invent a whole new job description out of thin-air.

-----




Applications are open for YC Winter 2016

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: