Last active
October 28, 2021 06:06
-
-
Save xvaara/771d3c92a62d4149fa4e4b6d629b1b2b to your computer and use it in GitHub Desktop.
Dark mode for PostgraphiQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>` | |
); | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use this: https://www.graphile.org/postgraphile/plugins/#inline-tweaks-via-pluginhook