Live data from Hacker News

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

github.com

301–310 of 319 posts

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

#301
post #293

Earlier quoted context omitted.

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.

I had forgotten how big a change conversation view was compared to other webmail. Also for what it's worth, I still use the Basic HTML view because I find it a better experience, so AJAX was definitely not the selling point for me. The 1GB thing was a huge factor though.

For me, the basic view has always felt neglected and kind of halfassed. The full experience has fully styled UI elements where as the basic view just defaults to the browser defaults. Outlook does this too.

To me it just feels like basic view is just v1.0 from 2004.

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

#302
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…

They just display stuff, right? I'm fine with having those in pure CSS if it can be done in an understandable and maintainable way. But the decision to display a message in a modal popup when you click a button is functionality and should be javascript. The behaviour of the modal popup itself is fine as CSS.

Well, that's my opinion at least.

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

#303
There are almost 300 comments here and no one has pointed out the obvious: these can be used within email templates where JavaScript is unavailable. For that reason alone, I think this is pretty cool.

But sure. Always use the right tool for the job, as they say, and for application logic that tool is not CSS.

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

#304
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/

It's defined in HTML 5.1, which is still Candidate Recommendation.

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

#305

Earlier quoted context omitted.

Lets be honest, 99% of people who disable javascript are programmers who take great honor in complaining about every website that is more than 200k in size. This is a non-issue for most companies.

I started disabling javascript since every site these days includes a gazillion badly crafted scripts that take up too much cpu. It actually brings my laptop to a grind (when having lots of tabs open)

Anecdotal evidence: I have no problems having more than 200 tabs open on a Thinkpad T60 – as long as any JavaScript is disabled. Enabling JavaScript makes such a thing hard; there exist web pages that raise CPU temperature by more than 10°C.

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

#306
post #124
post #66

Earlier quoted context omitted.

There are HN guidelines, and there's also the English grammar with a plethora of tools to help those with a mother tongue different than English like myself. HN is not a chatroom - it's a news website.

> HN is not a chatroom - it's a news website. I normally wouldn't comment on this but since you've self-identified as being interested in correct grammar and punctuation, I will. A hyphen isn't appropriate where you've used it. It should be an em dash. You can type an em dash with shift+option+hyphen on a Mac or by holding alt and typing 151 on Windows. http://logicmason.com/2013/the-difference-between-hyphens-en...

I never use Unicode, I use ASCII.

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

#307
post #131
post #97

Earlier quoted context omitted.

My sentence is fine according to Grammarly, LanguageTool, and Word. So, can you be more specific, please? Anyway, I was talking about basic rules that even idiots should get right.

> I was talking about basic rules that even idiots should get right. Ah, like politeness?

Politeness is for idiots who bang heads against brick walls.

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

#308
post #66

Earlier quoted context omitted.

There are HN guidelines, and there's also the English grammar with a plethora of tools to help those with a mother tongue different than English like myself. HN is not a chatroom - it's a news website.

You're complaining about casing and one missing apostrophe... if you cared this much, how come you didn't notice the title is missing two words to even make sense?

I am complaining about things that even idiots should know (and that better yet HN should detect and reject). English is not an easy language to master but doing proper casing and basic punctuation right should be no challenge.

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

#309

Earlier quoted context omitted.

You're complaining about casing and one missing apostrophe... if you cared this much, how come you didn't notice the title is missing two words to even make sense?

I am complaining about things that even idiots should know (and that better yet HN should detect and reject). English is not an easy language to master but doing proper casing and basic punctuation right should be no challenge.

You keep implying people are idiots for missing apostrophes and not casing how your lordship likes it, I'll keep flagging your posts. In the mean time, neither CSS nor JS are featured in the dictionary so why on earth do you think your initial post is appropriate?

I'm sure if you google enough you'll find a community that finds it acceptable as a whole to be rude to people who don't have proofreaders and a full publishing staff for their internet comments. Sure as hell hope HN isn't it.

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

#310
post #297

Earlier quoted context omitted.

I must be insane because I don't really see that much of a difference between the two examples you provided. I can read one just as well as the other.

The former has 46 words/348 characters; the latter 20 words/176 characters. That's more than twice the tokens, twice the disk space, twice the cognitive load.

Frankly, it's silly to think that cognitive load is directly proportional to number of words/characters.

For example, the latter relies on more implicit information (the order of the arguments), which can be harder to keep in mind than the keywords use by the former, particularly as you add more than two attributes. I'd say this version actually reduces the cognitive load, but it doesn't save as many words:

    (sul
     (stylesheet :href "chrome://global/skin" :type "text/css")
     (window :id "findfile-window" :title "Find Files"
             (button :id "find-button" :label "Find")
             (button :id "cancel-button" :label "Cancel")))
Post reply on HN