Live data from Hacker News

List.js

listjs.com

21–30 of 90 posts

Re: List.js

#22

This looks pretty useful. I'm curious why you used class to store the "category". Wouldn't it be cleaner to store it in"data-category" or just Javascript? Or is that less browser compliant? Overall a great script though.

The reason is simply that I wanted it to be as simple as possible, but if it seems to be a common request I could add support for data-attributes! (and yes, it "works" in IE, by using getAttribute())

Re: List.js

#23
post #4

kinda neat...but...you need to read: http://contrastrebellion.com/ and redesign your site...easily the biggest violation of my eyes ever.

That's an awful website too. White text on dark background is a complete readability failure, no matter how much contrast it provides.

In some agreement... According to an article on "color for developers" that was posted at some point on HN, one gets a better "pop" contrast if there is a smidgeon of color. As I read it, using white or black, regardless of the other color involved in the combo, is less effective. One should strive instead to add at least a little bit of color and contrast that color with the other. For example, if you toss a tiny bit of blue into your black, then you should toss a tiny bit of yellow/orange into your white. The contrast is not in symmetric values either; R, G, and B have different contributions to the brightness.

If I have the time to dig up the article I am thinking about, I will add it to this post.

(Here is the HN thread on the contrastrebellion site: http://news.ycombinator.com/item?id=2807047)

Re: List.js

#25
post #4

kinda neat...but...you need to read: http://contrastrebellion.com/ and redesign your site...easily the biggest violation of my eyes ever.

[deleted]

Re: List.js

#26
post #4

kinda neat...but...you need to read: http://contrastrebellion.com/ and redesign your site...easily the biggest violation of my eyes ever.

That's an awful website too. White text on dark background is a complete readability failure, no matter how much contrast it provides.

Twaddle! I find dark text on a white background unbearable. I'm much happier with off white on a dark background.

Anyway - each to their own. It looked okay to me, apart from some tiny script in places. (Safari, OSX 10.4, 1280x854)

Re: List.js

#27
post #12

Thanks, but you really need to change that to 7 KB. I thought to myself "7 MB? What a weird JS library" and was about to close the page.

I really changed it ;)

Re: List.js

#28
post #5
post #4

kinda neat...but...you need to read: http://contrastrebellion.com/ and redesign your site...easily the biggest violation of my eyes ever.

lol.. hn is on the list.

The screenshot is of an older version of HN. pg, Did the change occur as a result of showing up on Contrast Rebellion?

There's a fair amount of merit to downvoted comments having their contrast lowered.

Re: List.js

#29
post #22

This looks pretty useful. I'm curious why you used class to store the "category". Wouldn't it be cleaner to store it in"data-category" or just Javascript? Or is that less browser compliant? Overall a great script though.

The reason is simply that I wanted it to be as simple as possible, but if it seems to be a common request I could add support for data-attributes! (and yes, it "works" in IE, by using getAttribute())

i used to use class names to store data types (category is a perfect example). there's a really great reason to do this: you can style your objects based on that type of data without relying on CSS attribute selectors.

that said, i quickly learned that it's better to use data- attributes and copy them into the class when necessary. otherwise you end up with utilities like getCategoryFromClassName()

Re: List.js

#30
Maybe it's just me, but it took me a second to figure out what I was looking at. "HTML Lists" didn't pop out at me right away as specifically meaning and for some reason. You should put the source code by your examples so people see what little they put in for the output they see, and it'll clarify (at least to someone like me) exactly what is going on here.

EDIT: I see now that your front page is an example, with source code. That wasn't obvious to me.

Post reply on HN