Follow

Useful bit of code I keep handy in my devtools buffer:

```
document.body.parentElement.style.filter = "invert()"
```

This will apply a color inversion filter on an entire page so that you can force a dark mode on sites that don't ssupport it. (e.g. Google's suite)

· · Web · 2 · 3 · 8

@mauve as someone who still uses Gmail's web UI: THANK YOU THANK YOU

@todrobbins Lol! That's exactly what I use it for. I've had to use gmail cause of work and it's been a major sore every time I open my tab. :P

Been thinking of getting an extension or something together to auto-inject this based on domain.

@mauve @todrobbins I keep meaning to get an extension for that too but I reboot my computer into non-Haiku operating systems a bit too infrequently and when I do I always forget a few things before going back to Haiku.

@makeworld Oh yeah good point.

For anyone curious here's an article about how bookmarklets work and an example of how to turn that script into one:

freecodecamp.org/news/what-are

```
javascript:(()=>document.body.parentElement.style.filter="invert()")()
```

Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.