News for hackers. Stuff that matters.
Re:Little-Known CSS Facts by grimtrigger on Wednesday April 30, 2014 @07:33PM (#7677209)
A nifty little trick regarding #5:

You can create elements that maintain their aspect ratio using width:100% and padding-bottom:100%. Unintuitive, since you wouldn't expect padding-bottom to be based of the width.

http://stackoverflow.com/questions/1495407/css-a-way-to-main...

Re:Little-Known CSS Facts by jscheel on Wednesday April 30, 2014 @05:04PM (#7676428)
This article does a great job reinforcing the fact that the w3c has made an absolute mess of the css spec, and that browser vendors continue to implement crap. It's disheartening at best to think about css. I say this as I am wrangling YASCI (yet another stupid css issue).
Re:Little-Known CSS Facts by Pxtl on Wednesday April 30, 2014 @05:48PM (#7676704)
Sadly, http://giveupandusetables.com is no longer up, because I always liked pointing to that.

The amount of time we spend fighting with CSS to do things that are simple is insane.

The web is not a well-designed platform. It grew organically out of a document system under the stewardship of a million browser developers with no leadership, and it shows. It's a series of hacks upon hacks upon hacks that only make a reasonable, decent computing platform by the combined might of the entire software industry making tools and frameworks and JavaScript optimizing compilers and whatnot for it.

Re:Little-Known CSS Facts by null_ptr on Wednesday April 30, 2014 @07:20PM (#7677160)
Client-side web technologies are rotten and ill-designed, a mountain of patches and inconsistencies. That's why it's so painful to see people try to shoehorn JavaScript everywhere just because it's the unfortunate status quo.
Re:Little-Known CSS Facts by matthewmacleod on Thursday May 01, 2014 @05:53AM (#7678968)
CSS isn't really all that bad, and the trope is getting boring now.

Hindsight is 20/20, and it would have been difficult to foresee that the web would become an application platform in 1994, when the concept was being introduced to the web. CSS was primarily intended as a specification for styling documents, and not for implementing application layout - I would wager that most of the objections actually focus around it's unsuitability for this role.

That said, it's obvious that CSS is not currently optimal for the use cases that emerged. That's why we've had so much work on new versions, which attempt to solve some of the long-standing objections. From my perspective as a developer, it's working relatively well; even minor changes in the general availability of things like border-box sizing have made a huge difference to the ease of doing application layout in CSS, and the situation only continues to get better.

Re:Little-Known CSS Facts by Tloewald on Thursday May 01, 2014 @07:38AM (#7679200)
CSS is bad and hindsight is not required. Consider all the obvious page layout things that everyone wants, such as centering, columnar text, non-moving navigation elements, footers, and so forth that are either unsupported or require rocket science tricks to get half-working. And that's without getting into the inobvious requirements that they've had at least ten years to grapple with.

To be fair, some of CSS's shortcomings follow from HTML design errors that are equally egregious (and in some cases have been magnified by HTML5). E.g. It ahould have been possible to create decent looking navigation elements in HTML with no CSS or Javascript, but still isn't.

Re:Little-Known CSS Facts by matthewmacleod on Thursday May 01, 2014 @08:16AM (#7679283)
Consider all the obvious page layout things that everyone wants, such as centering, columnar text, non-moving navigation elements, footers, and so forth that are either unsupported or require rocket science tricks to get half-working.

These features are all now available in the latest CSS specs. Yes, it's taken a while to get there, but I absolutely dispute that these features are "obvious."

To be fair, some of CSS's shortcomings follow from HTML design errors that are equally egregious (and in some cases have been magnified by HTML5)

I don't in most cases agree that problems in HTML are "design errors," so much as "features it turned out we wanted that we didn't think we did."

E.g. It ahould have been possible to create decent looking navigation elements in HTML with no CSS or Javascript, but still isn't.

Again, I don't agree that this is something HTML should be involved with.

Re:Little-Known CSS Facts by Tloewald on Thursday May 01, 2014 @10:20AM (#7679880)
All the layout features used in publishing are obvious requirements for a document layout technology, especially when folks from Adobe, et al, are on the relevant committees.

All the layout features used in applications are obvious requirements for web applications.

It's perfectly reasonable to leave out a lot of stuff from early versions of a product or standard, but we're a long, long way past that.

> I don't agree that this is something HTML should be involved with.

HTML is involved with it, it's just badly involved. Either don't provide presentation controls or do it properly. Your opinion doesn't matter because there are facts on the ground.

Re:Little-Known CSS Facts by matthewmacleod on Thursday May 01, 2014 @11:18AM (#7680276)
All the layout features used in publishing are obvious requirements for a document layout technology, especially when folks from Adobe, et al, are on the relevant committees. All the layout features used in applications are obvious requirements for web applications. It's perfectly reasonable to leave out a lot of stuff from early versions of a product or standard, but we're a long, long way past that.

Okay, but CSS was a document layout spec for web documents, and has become to be used as a layout spec for interfaces. There are differences there - in other words, CSS is pretty unique in terms of the kinds of areas it has been trying to tackle. Say columnar text - I don't at all think that many people would have considered that it would be required back in the early days of the web. It turned out people did need it, and now we mostly have it.

So no, I don't think many of the things you talk about were obvious, and in any case we've mostly sorted the situation - it's taking a long time, but CSS is also special in that there are lots of implementations of it, and many of them are legacy. So don't expect overnight change.

HTML is involved with it, it's just badly involved. Either don't provide presentation controls or do it properly.

HTML was historically involved, because we didn't realise how important separation of structure and presentation would actually turn out to be. Now we're got a big legacy to deal with.

To be honest, I'd have preferred XHTML2 won, but I don't really think it's a massive deal either way - you're arguing for perfection, which exists in literally no software platform.

Your opinion doesn't matter because there are facts on the ground.

I'll leave you to think about the irony of that statement, and just point out that facts are open to interpretation.

Re:Little-Known CSS Facts by Tloewald on Thursday May 01, 2014 @07:40PM (#7683335)
A bald opinion backed by nothing does not contribute to the discussion. If you gave some kind of reason for disagreeing -- an interpretation if you will -- that would be something to discuss.
Re:Little-Known CSS Facts by Gracana on Thursday May 01, 2014 @08:20AM (#7679291)
I thought the first one about the color property seemed pretty obvious and fundamental. That's the whole "cascading" thing! But, if you learn CSS in bits and pieces, it's certainly something that's easy to miss.

Positioning is another fundamental topic that is hard to learn without really taking a close look. It's not glamorous or new, but I think a lot of people (myself included, until recently) don't fully understand how positioning works. A List Apart has a good article on the subject: http://alistapart.com/article/css-positioning-101

In the same vein, another good topic is selectors. They're quite powerful, but if you only ever look at simple styling examples, you'll never really be exposed to their breadth and power. Check out the docs: http://www.w3.org/TR/CSS21/selector.html

Re:Little-Known CSS Facts by darksim905 on Thursday May 01, 2014 @03:11AM (#7678647)
I haven't done CSS in a while & my site is pretty lame, but:

There's a CSS clip property? And a collapse toggle? holy shit.

This is really cool, thanks!

Re:Little-Known CSS Facts by jcomis on Wednesday April 30, 2014 @08:16PM (#7677377)
Anyone else seeing the same codepen example for every number?

edit: hmm, a few refreshes fixed it up.

Re:Little-Known CSS Facts by ImpressiveWebs on Thursday May 01, 2014 @03:01AM (#7678630)
For some reason, that happens occasionally. Seems to be a CodePen bug, but it does fix if you refresh, as you mentioned.
Re:Little-Known CSS Facts by Qantourisc on Wednesday April 30, 2014 @05:25PM (#7676572)
border-image isn't used at the moment, because it's out of fashion, but one day perhaps it will be back.
Re:Little-Known CSS Facts by n0rm on Wednesday April 30, 2014 @07:12PM (#7677129)
and hopefully a css native <blink> tag !
Re:Little-Known CSS Facts by evan_ on Wednesday April 30, 2014 @07:49PM (#7677268)

    text-decoration: blink;
https://developer.mozilla.org/en-US/docs/Web/CSS/text-decora...

(Doesn't actually seem to work in Chrome. Here's a CSS animation alternative: http://stackoverflow.com/questions/13955163/imitating-a-blin... )

Re:Little-Known CSS Facts by russellsprouts on Wednesday April 30, 2014 @08:54PM (#7677511)
If you really want to re-enable blink tags, drop this in. It's terrible code, but it is also tweetable. Besides, if you are using blink tags, who cares about a few global variables?

Example: http://ryanrussell.me/404

    setInterval('for(v="visibility",b=document.querySelectorAll("blink"),a=b.length;a--;)c=b[a].style,c[v]=c[v]?"":"hidden"',999)
Re:Little-Known CSS Facts by mhitza on Wednesday April 30, 2014 @10:53PM (#7677957)
These all seem pretty basic CSS facts.