Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Tiny (222 Bytes) Dark Mode bookmarklet to enable darkmode anywhere (github.com)
19 points by x8d 25 days ago | hide | past | web | favorite | 7 comments

This is really neat! It would be great as a Greasemonkey script or a browser extension.

Nitpick, it's actually 221 bytes. And if you

on something that doesn't have style, it returns `null`. So maybe

  (e.getAttribute('style') || '')

Hey thanks, I had this condition in the script at one point, but then I started minifying it and although this makes the style attribute look a bit ugly the functionality stays the same, so it had to go.

Thanks, that's really neat.

Would it be possible to make it a switch so that clicking the bookmarklet toggles darkmode?

Oh, it has already been added as an issue: https://github.com/x08d/222/issues/2

What are you going to do if you ever need to make any sort of change to the project? Rename the project?

222 is also the hex color, so the name would make sense still.

This is awesome, thank you!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact