Re:H2 {position: sticky} [video]
by iSnow on Thursday September 12, 2013 @05:40AM
(#6373067)
I am not sure I like how CSS gets bloated with special case behaviors like this. Sticky headers seem to me like animated gifs - something that is hugely popular for several years and then goes away silently because it is more eye candy than useful.
[ Parent
| on HN ]
That would be a fair argument if people weren't already building slower and massively more hacky solutions in Javascript. So clearly there is a demand for this 'special case' because people are already building workarounds. Sadly those workarounds will never be a smooth as browser-supported CSS property. Thus I think it makes a lot of sense to include this at the browser level.
And while you're right that, like any CSS property or HTML tag, there's the possibility of abuse, this particular property does have some genuine usability gains (table headings being a great example). So it seems silly to discourage the addition of sticky based on a vague fear of CSS becoming bloated and the potential of few evil sites over using it.
Sticky has more uses than just headers, for instance sidebars and other sorts of control panels can make use of it to improve usability as well. It's a usability feature, not a fad design feature.
You mean like in the bootstrap documentation, where with a small enough viewport you cannot access bottom of the menu?
Re:H2 {position: sticky} [video]
by jasonlotito on Thursday September 12, 2013 @09:33AM
(#6373858)
That's a failure of the implementation, not a failure of the concept. Having dealt with implementing things like that in the past, I can't offer an excuse other than laziness for those implementations. However, it doesn't take away from the concept.
I agree. The CSS standard seems like a giant hack job. Which I suppose is generally the case for non turing languages that have to stay relevant in a changing world.
Since it's already a giant hack job, and it still doesn't do what we want with all its plethora of existing hacks, you may as well add one more hack. It's not like there's some conceptual purity of CSS that's worth saving - it's piss-poor at doing its job of laying out complete pages. We suffer it because of the universality of HTML+CSS across every platform.
Having an always-visible "current section" header while scrolling a large document seems quite useful to me...
Table-based layout was useful and frequently easier too and we still abandoned it. I still believe this is behavioral markup and should be done in JS.
mind explaining what you mean by behavioral markup?
CSS that tries to be a declarative approach to describing behavior. This is wrong in my opinion like HTML tags for styling were wrong. I think this is wrong because behavior is so incredibly complex that you end up defining rules for everything - and in the end, using a imperative language is much simpler.
I know it's different, but the argument here http://dealloc.me/2011/06/24/d3-is-not-a-graphing-library.ht... applies in a similar way.
Are you also then against CSS transitions?