From f7764fd08e8cdb05e5680f08f98600d7d05afdd8 Mon Sep 17 00:00:00 2001 From: "mattia.astorino" Date: Thu, 4 Aug 2016 10:57:45 +0200 Subject: [PATCH] fix: Improved theme configurator for ST < 3119 --- mt_config.py | 93 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 80 insertions(+), 13 deletions(-) diff --git a/mt_config.py b/mt_config.py index 62a6c7721..c21805ee6 100644 --- a/mt_config.py +++ b/mt_config.py @@ -84,19 +84,86 @@ UNMARKED = "☐" RADIO_MARKED = "•" RADIO_UNMARKED = "•" -css = """\ - -html { padding: 16px; } -p { margin: 0; padding: 0; text-decoration: none; } -a { - display: inline-block; - padding: 0.25em 0; - text-decoration: none; +STYLE = """\ +html, +body { + padding: 0; } -h1, h2, h3, h4, h5, h6 { margin-top: 0; padding-top: 0; padding-bottom: 20px; } -.mt-config.small { font-size: {{'*.8px'|relativesize}}; } -.mt-config.ui-control { text-decoration: none; } -.mt-config.ui-backlink { text-decoration: none; padding: 4px 0; } + +{%- if var.sublime_version < 3119 %} + + markdown, html { + padding: 16px; + } + + p { + margin: 0; + padding: 0; + text-decoration: none; + } + + a { + display: block; + padding: 0.25em 0; + text-decoration: none; + } + + h1, h2, h3, h4, h5, h6 { + margin-top: 0; + padding-top: 0; + padding-bottom: 20px; + } + + .mt-config.ui-control { + text-decoration: none; + } + + .mt-config.ui-backlink { + text-decoration: none; + padding: 4px 0; + } + +{%- else %} + + .mdpopups { + padding: 16px; + } + + .mdpopups h1, + .mdpopups h2, + .mdpopups h3, + .mdpopups h4, + .mdpopups h5, + .mdpopups h6 { + margin-top: 0; + padding-top: 0; + padding-bottom: 20px; + } + + .mdpopups p { + margin: 0; + padding: 0; + text-decoration: none; + } + + .mdpopups a { + display: inline-block; + padding: 0.25em 0; + text-decoration: none; + } + + .mdpopups .mt-config.ui-control { + text-decoration: none; + } + + .mdpopups .mt-config.ui-backlink { + {{'.foreground'|css}} + text-decoration: none; + padding: 4px 0; + display: block; + } + +{%- endif %} """ @@ -222,7 +289,7 @@ def show_popup(self, menu): mdpopups.show_popup( self.view, ''.join(popup), - css=css, + css=STYLE, on_navigate=self.on_navigate, max_width=800, max_height=400