mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-04-30 03:22:56 -05:00
fix: markdown webview dark mode
This commit is contained in:
@@ -63,7 +63,21 @@ class MarkdownWebView extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Provider.of<ThemeModel>(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user