Last active
June 15, 2020 10:44
-
-
Save Galadirith/973a91253b92fbd95aec3b022fb76337 to your computer and use it in GitHub Desktop.
dev.to light syntax colour for code snippets in articles, the editor, and article comments
This file contains hidden or 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
function add_css(rule) { | |
let css = document.createElement('style'); | |
css.type = 'text/css'; | |
css.appendChild(document.createTextNode(rule)); | |
document.getElementsByTagName("head")[0].appendChild(css); | |
} | |
let rule = '.container .body pre, .crayons-article__body pre, div.inner-comment div.body div.highlight pre.highlight {background: hsla(240, 6%, 4%, 1); filter: invert(1);}'; | |
rule += '.container .body pre code, .crayons-article__body pre code {background: hsla(240, 6%, 4%, 1);}'; | |
add_css(rule) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
invert text color based on background in css
By way of
google: invert colors div css