Live data from Hacker News

CSS is powerful, you can do a lot of things without JS

github.com

241–250 of 319 posts

Re: CSS is powerful, you can do a lot of things without JS

#241

Earlier quoted context omitted.

My current-favorite problem with modern web development is mobile-specific redirection. e.g. you click a link in your email and it takes you to "www.foo.com/somethingWithParametersAndImportantStuff", foo.com detects you're on a phone and redirects you to their mobile homepage at "m.foo.com", blowing away your URL or even better not supporting your particular URL's page in the mobile site... where... your mobile brows…

http://xkcd.com/869/ Anyone know where I can find publication dates for individual comics? I don't see anything on the comic's page.

The archive page -- http://xkcd.com/archive/ -- has each comic listed by title, with the publication date in the hover text. Server Attention Span was published 2011-3-7.

Re: CSS is powerful, you can do a lot of things without JS

#242

Earlier quoted context omitted.

Days of the old web where flash was pervasive and best viewed in [IE6|Netscape|Mosaic|...] pages were everywhere. Every generation of the web has had really crappy devs building bad experiences. The current generation is not making anything worse than it's predecessor.

> ...and best viewed in [IE6|Netscape|Mosaic|...] pages were everywhere We have "best viewed in Chrome" today, which is no different.

nope I agree, like I said it's as bad as it ever was. The past wasn't better.

Re: CSS is powerful, you can do a lot of things without JS

#243
post #231

Earlier quoted context omitted.

The point is: Usually, you must know the rules to break them. In this particular context, looks like the original rules are fading away. No rules = Anarchy.

Nitpick, but anarchism is not the lack of rules, it's the lack of rulers.

My bad, thanks for pointing it out.

Re: CSS is powerful, you can do a lot of things without JS

#244

Earlier quoted context omitted.

If it comforts you, I used an upside-down SNES gamepad for a few years before ever touching a mouse. And today I use my mouse far more than any game controllers.

I'm more curious why it was upside down.

I just grabbed one and starting using it upside-down. By the time anyone told me it was wrong, it already felt more natural to use it that way.

Re: CSS is powerful, you can do a lot of things without JS

#245
post #122

I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.

I think the best way to deal with that is to use a CSS processor (I prefer Sass). You can make a "mixin" (or whatever term your processor prefers) that accepts a selector and styles it. Still readable, still no JS required (if you want to go that route), and you can document the heck out of it. "Oh no, more tooling". Yeah, more tooling.

Re: CSS is powerful, you can do a lot of things without JS

#246

Earlier quoted context omitted.

I often hear rationalizations about how x couldn't be built with graceful degradation in mind. There certainly are _some_ examples (games, for example). But GMail doesn't strike me as a particularly compelling example. GMail is also _just content_. The fancy ajax interactions, though nice, are hardly required for an email client.

This is a-historical by my memory - the entire reason Gmail became so successful was that its use of "fancy ajax interactions" made it shockingly nicer to use than any of its competitors at the time. I think if one of your main selling points is interactivity afforded by javascript, then it is unlikely to have much return on investment to accommodate users who don't want that. But for sure people should be thinking h…

AJAX isn't why Gmail became successful. What set Gmail apart from its competitors was the huge amount of initial storage you got (1 GB for free at a time when Hotmail offered less than 10 MB for free), a higher maximum attachment size (25 MB compared to the webmail standard 10 MB), Google search, and conversation view. All of which, by the way, worked with the AJAX-free basic HTML view.

Re: CSS is powerful, you can do a lot of things without JS

#247
post #122

I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.

Using HTML5 tags such as , you don't need CSS or JS!

Try this in Chrome: https://jsfiddle.net/timdavila/f5rcarmn/

Re: CSS is powerful, you can do a lot of things without JS

#248
post #44

I prefer using CSS for my styling and javascript for my functionality, as God intended. These examples could be educational for getting a bit more out of your CSS while keeping only the pure functionality in javascript. Too much styling-related stuff seems to be sneaking into code these days. I like my concerns separated.

> I prefer using CSS for my styling and javascript for my functionality To play devil's advocate, though... is an accordion or a carousel "functionality" any more than, say, a drop-down or a multi-line input box is? I mean, the games examples are pretty wacky (in a cool but "thank God I don't have to debug these" way), but things like tabs and tree views are so ubiquitous that a case could be made for having standard…

> a case could be made for having standard HTML input tags for them.

and for the accordion at least, the case was made and approved. check out and

Re: CSS is powerful, you can do a lot of things without JS

#249
The biggest problem with these hacks isn't a preference for CSS over JS (which IMO is fine in moderation); it's the fact that they aren't keyboard or screenreader accessible. A person using a screenreader can't even navigate to the accordion (http://jsfiddle.net/yn4ls/), and if they could, it would tell them it's a form element.

Re: CSS is powerful, you can do a lot of things without JS

#250

The biggest problem with these hacks isn't a preference for CSS over JS (which IMO is fine in moderation); it's the fact that they aren't keyboard or screenreader accessible. A person using a screenreader can't even navigate to the accordion ( http://jsfiddle.net/yn4ls/ ), and if they could, it would tell them it's a form element.

Yeah, that's an uncool abuse of the checkbox element. I'd rather be conventional than clever when it comes to layout.
Post reply on HN