mirror of
https://github.com/git-touch/git-touch
synced 2024-12-15 09:56:15 +01:00
fix: markdown webview dark mode
This commit is contained in:
parent
6f34c382be
commit
979e91378b
@ -63,7 +63,21 @@ class MarkdownWebView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return HtmlView(html, cssText: theme.markdownCss);
|
||||
var css = theme.markdownCss;
|
||||
if (theme.brightness == Brightness.dark) {
|
||||
css += '''
|
||||
html {
|
||||
background-color: #000;
|
||||
}
|
||||
.markdown-body {
|
||||
filter:invert(100%);
|
||||
}
|
||||
.markdown-body img {
|
||||
filter:invert(100%);
|
||||
}'
|
||||
''';
|
||||
}
|
||||
return HtmlView(html, cssText: css);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user