diff --git a/data/media/style_dark.css b/data/media/style_dark.css deleted file mode 100644 index e69de29..0000000 diff --git a/data/media/uberwriter_dark.css b/data/media/uberwriter_dark.css new file mode 100644 index 0000000..ff64d10 --- /dev/null +++ b/data/media/uberwriter_dark.css @@ -0,0 +1,6 @@ +@import("uberwriter.css") + +body { + color: #EDEDED; + background-color: #333; +} \ No newline at end of file diff --git a/uberwriter/UberwriterWindow.py b/uberwriter/UberwriterWindow.py index 55e77ad..f046158 100644 --- a/uberwriter/UberwriterWindow.py +++ b/uberwriter/UberwriterWindow.py @@ -703,12 +703,18 @@ class UberwriterWindow(Window): base_path = '' os.environ['PANDOC_PREFIX'] = base_path + '/' + # Set the styles according the color theme + if self.settings.get_value("dark-mode"): + stylesheet = helpers.get_media_path('uberwriter_dark.css') + else: + stylesheet = helpers.get_media_path('uberwriter.css') + args = ['pandoc', '-s', '--from=markdown', '--to=html5', '--mathjax', - '--css=' + helpers.get_media_path('uberwriter.css'), + '--css=' + stylesheet, '--lua-filter=' + helpers.get_script_path('relative_to_absolute.lua'), '--lua-filter=' + helpers.get_script_path('task-list.lua')]