feat(dark-mode): Double invert filter for nice dark HTML bodies

This commit is contained in:
Ben Gotow 2015-11-20 18:53:34 -08:00
parent d437e6866f
commit 5d4c1b96a9
3 changed files with 14 additions and 1 deletions

View file

@ -45,7 +45,9 @@ class EmailFrame extends React.Component
# `padding`.
doc.write("<!DOCTYPE html>")
EmailFixingStyles = document.querySelector('[source-path*="email-frame.less"]')?.innerText
EmailFixingStyles = ""
for sheet in document.querySelectorAll('[source-path*="email-frame.less"]')
EmailFixingStyles += "\n"+sheet.innerText
EmailFixingStyles = EmailFixingStyles.replace(/.ignore-in-parent-frame/g, '')
if (EmailFixingStyles)
doc.write("<style>#{EmailFixingStyles}</style>")

View file

@ -7,5 +7,6 @@
"engines": {
"nylas": "*"
},
"styleSheets": ["email-frame"],
"private": true
}

View file

@ -0,0 +1,10 @@
.ignore-in-parent-frame {
body {
-webkit-filter: invert() hue-rotate(180deg);
color: #111;
}
img {
-webkit-filter: invert() hue-rotate(180deg);
}
}