I upvoted this like I try to do for most good effort/well-intentioned Show HN's, but I wasn't planning on installing it since I had customized my HN settings to make my HN usage as discrete as possible, with `topcolor` set to #f6f6ef (wish bodycolor was also a setting so I could just make the header and the HN body #eeeeee!).
But after reading some of the other comments I decided to add the plugin and am feeling that I won't regret it :) Not only do I love the use of pink in general, I love this theme's particular choices, such as the blue accent for the headline links and the muted pink for visited links for even better minimalist readability. The minimized header is a also nice touch (though maybe `new`, `threads`, and `submit` deserve emphasis -- at least based on my habits). And I guess if I want my web browser not to scream "HACKER NEWS READER" to anyone looking over my shoulder, a theme that hides the "Hacker News" header in addition to adding a pink explosion will do the trick. Thanks!
Thanks so much! I'm glad you decided to install it, feel free to let me know if you see anything that could be improved. I was inspired by the color scheme from Bubblesort's "Git it Gurl" shirts (https://shop.bubblesort.io/products/git-it-gurl-shirt?varian...), with the nice splash of blue-purple on the pink background.
So my biggest immediate complaint is that the up/down hearts are misleading. I was a little excited that the uphearts/downhearts appeared to be slightly offset, which would deal with one of HN's most annoying design flaws -- accidentally hitting the wrong vote button. As it is, your hearts have the same horizontal hitbox even though they appear visually skewed. Having the hitbox match the appearance of the hearts would be welcome!
The other fix I would make is in the font-color of a few elements that are now more emphasized than they need to be. e.g. The "unvote" label seems to be in the darkest shade of font color.
As someone who doesn't mind that it is a Chrome plugin, since Chrome is the browser I use for HN and because I don't mind that the plugin has access to that page -- I say keep it as a plugin rather than make it a CSS sheet. With a plugin, you could provide a polished config panel experience that makes it easy for a user to disable/enable features. For example, I could see myself liking the "Hacker News" masthed back in the header and in a hot pink shade -- but other users may want it gone like it is now.
Of course as a plugin it could add all sorts of features to the HN page, at risk of breaking the minimalist experience. All I think I would want in extra features is maybe he ability to switch between a few different variants of pink styling.
Interesting feedback, I will definitely take all of this under consideration for if and when I release a second version. It would be great to include more customizability, especially since it being a chrome plugin opens the door for all sorts of possibilities. Thanks so much!
Mostly because I'm familiar with developing Chrome extensions, and appreciate the freedom and ease of distribution. I also used a bit of Javascript to rework some of the text areas, like the bar at the top. And injecting the favicon is done in JS as well.
I'll look into custom CSS extensions though! I'm not familiar with them. The repo is at https://github.com/carolinehermans/HNcute – it could definitely be organized better, I didn't expect to be sharing!
Some of the other bits done in JS can be done in CSS; this snippet, for example:
for (let i = 0; i < document.getElementsByTagName("font").length; i++) {
if (document.getElementsByTagName("font")[i].getAttribute("color") === "#ff6600")
document.getElementsByTagName("font")[i].setAttribute("color", "#FF83C6")
}
This is very inefficient (though document.getElementsByTagName is probably O(1) due to its return type HTMLCollection being live, so the end result is probably still only O(n) on the number of <font> elements in the document; it’d be O(n²) with document.querySelectorAll); you should only get the <font> elements once, like this:
const fontElements = document.getElementsByTagName("font");
for (let i = 0; i < fontElements.length; i++) {
if (fontElements[i].getAttribute("color") === "#ff6600")
fontElements("font")[i].setAttribute("color", "#FF83C6")
}
It can still be made more efficient, but all I wanted to do was rewrite it in CSS anyway:
font[color="#ff6600"] {
color: #ff83c6;
}
Same deal on the table cells just above it:
for (let i = 0; i < document.getElementsByTagName("TD").length; i++) {
if (document.getElementsByTagName("TD")[i].getAttribute("bgcolor") === "#ff6600")
document.getElementsByTagName("TD")[i].setAttribute("bgcolor", "#fbbfdf")
}
On the performance matter, a rule of thumb: don’t call getElementsByTagName, getElementsByClassName, querySelector and querySelectorAll more than you absolutely have to. Or anything, really. Cache things in temporary variables aggressively. Take these two lines, for example:
Even then, this indexes pagetops twice as often as is necessary, but that operation is quite a bit cheaper than getElementsByClassName. I’d say then to use for..of or forEach or similar, or assign temporaries.
Have you thought about doing a write up on how to build a extension like this for Chrome?
I myself have often been thinking about building a Chrome extension but never gotten around to do it because I'm not sure where to start, something like this seems like a good scope for a first Chrome extension.
Also on a side-note, I checked out your github and saw your foureyes repository, that's a really neat idea I really love that project. You could probably turn that into a business (especially if you build an app for it and sell inbound traffic/affiliate marketing to resellers of glasses/sunglasses).
While you are at it, have you considered publishing it to the Firefox and Edge extension stores? Supposedly it is pretty easy to convert a Chrome extension to work in Firefox and Edge these days.
(I'd consider using it on Edge, for at least one user.)
But on the other hand a user who is already interested in overriding the styling for one site is a likely candidate for wanting to install more.
Furthermore, having one extension to trust for security's sake is much nicer than having one for each and every site you want to custom theme. Especially since the general theme is going to want to build up a library of themes and requires user trust to do so, phoning home secret information would eventually destroy that trust. But an extension that only themes Google.com is a more likely candidate for harvesting credentials, for instance.
Creating an extension is also a browser specific process. If there's one browser extension for all sites backed by a repository of plain CSS themes, then users on multiple browsers can benefit from theming with minimal porting effort on the part of the theme author.
I had no idea it was possible to override site stylings, and though I may look into it, I may not do anything more about it and just keep on accepting sites as they come, even if they're unappealing. So this is a great option - I can change HN to a more pleasant appearance without having to know about the details.
Those are good ideas for improvements, but I'm glad just to have the possibility for change, even if the first draft isn't perfect.
Nice work, and thanks for sharing! I think your repo serves as a great example of how simple a Chrome extension can be, so it has value as reference material.
Just an idea, but maybe at a high karma threshold, logged in users can reference a cross-origin style sheet, via linked URL?
User profile page would need to be a safe page, so users don't lock themselves out with wonky styles.
Also, stern warnings about privacy surrounding referrer headers and basic ad tech concepts like tracking pixels. Although browser extensions are just as deadly or worse.
I like it, there are some colors that are still present like the comments view still has the orange and red colors here and there. I will keep it installed and look for updates :)
One request would be to make the font sizes a bit bigger, maybe different font families as well!
I'll look for remaining orange/red areas and push an update later tonight. Good call on the font sizes! I used Open Sans because I wanted things to stay simple and easy to read, but it might be nice to look into something else in the future.
I've updated my Greasemonkey plugin that makes some minor changes to HN's text layout. It unfades faded comments, highlights inline quotes (prefaced with '>') and improves readability.
It's very small and uses calls to HN's own javascript. Too small to be worth its own post but .. this seemed like a good thread to post it as a comment.
It'd probably be simpler to do this as a userstyle, since there are many extensions supporting userstyles. Still, if you prefer the WebExtension format that Chrome provides, it's worth noting you could trivially release the same extension for Firefox and Edge, since I'm sure all of the APIs this uses are compatible.
How long will I have to wait for the Firefox port? This extension is yet another way that free software is being shut out of the browser market. And worse, women are being targeted to be locked into proprietary software.
Cmon y'all, this is super important. Let's get started on GNU/HNCute!
Chromium is not proprietary software, it is open source. This extension is written for open source browsers as well, not just the proprietary Chrome browser.
It's so unusual a thing to do that it becomes clever for that reason. Maybe other things too—I haven't looked. But I'd say it passes the "interesting new phenomenon" test (https://news.ycombinator.com/newsguidelines.html). Small things can do that as easily as big ones, if not more.
your comment can be said to be grumpy also. See?
sorry i dont get why people are salty, I dont find it interesting and just wondered what people found interesting. Why do you have to get defensive?
The Bad Guys used it in a slogan! Therefore we all must roll onto our backs into obedience position whenever we hear it now! Surely the bad guys will lose if we do this gesture for them?
But after reading some of the other comments I decided to add the plugin and am feeling that I won't regret it :) Not only do I love the use of pink in general, I love this theme's particular choices, such as the blue accent for the headline links and the muted pink for visited links for even better minimalist readability. The minimized header is a also nice touch (though maybe `new`, `threads`, and `submit` deserve emphasis -- at least based on my habits). And I guess if I want my web browser not to scream "HACKER NEWS READER" to anyone looking over my shoulder, a theme that hides the "Hacker News" header in addition to adding a pink explosion will do the trick. Thanks!