Skip to content

Instantly share code, notes, and snippets.

@xvaara
Last active October 28, 2021 06:06
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xvaara/771d3c92a62d4149fa4e4b6d629b1b2b to your computer and use it in GitHub Desktop.
Save xvaara/771d3c92a62d4149fa4e4b6d629b1b2b to your computer and use it in GitHub Desktop.
Dark mode for PostgraphiQL
const graphiqlBrandingTweak = {
["postgraphile:graphiql:html"](html: string) {
console.log("Applying GraphiQL Branding Tweak...");
return html.replace(
"</head>",
`<style type="text/css">
@media (prefers-color-scheme: dark) {
html {
filter: invert(1) hue-rotate(180deg);
}
html img,
picture,
video{
filter: invert(1) hue-rotate(180deg);
}
}
</style>
</head>`
);
},
};
@benjie
Copy link

benjie commented Mar 3, 2021

@xvaara
Copy link
Author

xvaara commented Mar 3, 2021

Screenshot 2021-03-03 at 15 17 40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment