Show HN: Tiny (222 Bytes) Dark Mode bookmarklet to enable darkmode anywhere (github.com) 19 points by x8d 6y ago ↗ HN
[–] datfrojo 6y ago ↗ What are you going to do if you ever need to make any sort of change to the project? Rename the project? [–] quickthrower2 6y ago ↗ 222 is also the hex color, so the name would make sense still.
[–] gabrielsroka 6y ago ↗ 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 e.getAttribute('style') on something that doesn't have style, it returns `null`. So maybe (e.getAttribute('style') || '') [–] x8d 6y ago ↗ 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.
[–] x8d 6y ago ↗ 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.
[–] kseistrup 6y ago ↗ Thanks, that's really neat.Would it be possible to make it a switch so that clicking the bookmarklet toggles darkmode? [–] kseistrup 6y ago ↗ Oh, it has already been added as an issue: https://github.com/x08d/222/issues/2
[–] kseistrup 6y ago ↗ Oh, it has already been added as an issue: https://github.com/x08d/222/issues/2
7 comments
[ 4.6 ms ] story [ 25.6 ms ] threadNitpick, it's actually 221 bytes. And if you
on something that doesn't have style, it returns `null`. So maybeWould it be possible to make it a switch so that clicking the bookmarklet toggles darkmode?