Settings

Theme

Show HN: HNCute, a pretty pink Hacker News theme

chrome.google.com

208 points by caroherm 8 years ago · 84 comments

Reader

danso 8 years ago

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!

  • carohermOP 8 years ago

    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.

    • danso 8 years ago

      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.

      • carohermOP 8 years ago

        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!

  • akras14 8 years ago

    You may like my side project.

    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.

  • chrismorgan 8 years ago

    My topcolor is #abcdef. I’m also quite fond of #123456 (though not as a topcolor).

taspeotis 8 years ago

Personally I find HackerNew [1] to be quite a sensible addition to the HN theme.

[1] https://chrome.google.com/webstore/detail/hackernew/lgoghlnd...

faitswulff 8 years ago

I unironically find this much easier to read HN with. Especially with dead or downvoted comments. The hearts are just a bonus.

BugsJustFindMe 8 years ago

Why is it a Chrome extension instead of just a bit of CSS in one of the many custom CSS extensions that already abound?

  • carohermOP 8 years ago

    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!

    • maddyboo 8 years ago

      I reaaalllyy like this theme! As others have said, it would be great to have it in the UserStyles library.

    • chrismorgan 8 years ago

      You can change the colour of the logo with CSS filters, something like this:

        [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.
      • carohermOP 8 years ago

        This is EXCELLENT, thank you so much for this. I'm absolutely going to implement these changes.

    • hultner 8 years ago

      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).

    • WorldMaker 8 years ago

      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.)

  • e12e 8 years ago

    Indeed. Appears the "stylish" extension and/or https://userstyles.org would be a natural fit for this?

  • ttsda 8 years ago
  • carlosdp 8 years ago

    idk, cause the one-click install is easier to distribute than telling people to install a generic plugin they might only use for this 1 mod anyways.

    • reificator 8 years ago

      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.

      • Woberto 8 years ago

        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.

jancsika 8 years ago

Instant upvote to anyone who forks it to append cat and giggle emojis to any post that references the chrome extension.

"Why is HNCutePlus on Hacker news?" giggles kittens

chrisparton1991 8 years ago

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.

  • carohermOP 8 years ago

    Thanks so much! I'm planning to clean up the repo later tonight so it's better organized.

advertech 8 years ago

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.

numbers 8 years ago

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!

  • carohermOP 8 years ago

    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.

krapp 8 years ago

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.

https://openuserjs.org/scripts/kennethrapp/Hacker_News_Text_...

hycaria 8 years ago

I like the color theme but dislike how everything seems more spaced out.

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.

darkkindness 8 years ago

Ah, this is something I didn't know I needed. Nice work!

andkon 8 years ago

THIS IS SO GOOD. And readable! But mostly adorable.

nyxtom 8 years ago

At first I thought I wasn't going to like this but I was pleasantly surprised :D The hearts are a nice touch :D Nice work :D

jchw 8 years ago

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.

ninjakeyboard 8 years ago

I have my hn bar set as pink with the Karma-unlocked feature. This is tempting though...

  • carohermOP 8 years ago

    I originally was going to just do this but didn't realize you needed a certain amount of Karma

dvt 8 years ago

Great job, looks cute! HN should make this the default style for Valentine's day :)

TheArcane 8 years ago

Is there a dark HN theme anyone recommends? On Stylish or outside?

anandkulkarni 8 years ago

Enjoying this theme. Thanks for sharing. Makes HN more fun!

_RPM 8 years ago

Neat. I’ll show this to my wife. She will love the colors.

nomadiccoder 8 years ago

how on firefox?

probinso 8 years ago

love it

labster 8 years ago

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!

shapiro92 8 years ago

why is this even on the top? no offense but it is a css stylesheet.

  • dang 8 years ago

    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.

  • jwilk 8 years ago

    From the HN guidelines:

    Please don't complain that a submission is inappropriate. If a story is spam or off-topic, flag it.

  • pvg 8 years ago

    You should install it and then try reading your own grumpy comment again. See?

ninkendo 8 years ago

> make HN cute again

Can we stop using “make X Y again”? The phrase it references is a racist dogwhistle. Let’s not normalize it.

  • carohermOP 8 years ago

    I thought about this and wound up changing the wording, the changes should be live with the next update within the next hour

    • danso 8 years ago

      Thanks, implying that HN had lost its cuteness was also extremely rude

  • zanedb 8 years ago

    I think it's more intended in a mocking manner.

  • dukeflukem 8 years ago

    Pardon my ignorance, but what's racist?

    • cypherpunks01 8 years ago

      They're referring to the POTUS campaign slogan, which isn't overtly racist but can be interpreted in such a way depending on your read of the message.

  • Retra 8 years ago

    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?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection