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!
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.
https://www.techtldr.com/posts/2018/summary-for-2018-01-03/
One sentence summary, keywords and statistics for best HN posts with score greater than 50, aggregated daily.
The theme does not look like HN, so thought you might like that.
[1] https://chrome.google.com/webstore/detail/hackernew/lgoghlnd...
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!
[href="https://news.ycombinator.com"] > img {
filter: hue-rotate(-50deg) brightness(150%);
}
… but that doesn’t fix the favicon.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")
}
Use this CSS instead: td[bgcolor="#ff6600"] {
background-color: #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: document.getElementsByClassName("pagetop")[0].innerHTML = document.getElementsByClassName("pagetop")[0].innerHTML.split("|").join(" ")
document.getElementsByClassName("pagetop")[1].innerHTML = document.getElementsByClassName("pagetop")[1].innerHTML.split("|").join(" ")
You’ve evaluated `document.getElementsByClassName("pagetop")` four times instead of once. const pagetops = document.getElementsByClassName("pagetop");
pagetops[0].innerHTML = pagetops[0].innerHTML.split("|").join(" ")
pagetops[1].innerHTML = pagetops[1].innerHTML.split("|").join(" ")
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.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).
(I'd consider using it on Edge, for at least one user.)
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.
"Why is HNCutePlus on Hacker news?" giggles kittens
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.
One request would be to make the font sizes a bit bigger, maybe different font families as well!
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.
https://openuserjs.org/scripts/kennethrapp/Hacker_News_Text_...
Also as a female, maybe not very professionnal after all. Rather have people recognize HN on my browser than wonder what girly stuff I might do.
/s
Cmon y'all, this is super important. Let's get started on GNU/HNCute!
Please don't complain that a submission is inappropriate. If a story is spam or off-topic, flag it.
Can we stop using “make X Y again”? The phrase it references is a racist dogwhistle. Let’s not normalize it.