mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 01:54:40 +08:00
feat(dark-mode): Double invert filter for nice dark HTML bodies
This commit is contained in:
parent
d437e6866f
commit
5d4c1b96a9
3 changed files with 14 additions and 1 deletions
|
@ -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>")
|
||||
|
|
|
@ -7,5 +7,6 @@
|
|||
"engines": {
|
||||
"nylas": "*"
|
||||
},
|
||||
"styleSheets": ["email-frame"],
|
||||
"private": true
|
||||
}
|
||||
|
|
10
internal_packages/ui-dark/styles/email-frame.less
Normal file
10
internal_packages/ui-dark/styles/email-frame.less
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue