From 52fbe18bee57a4f77d1e285886094a4be9d17527 Mon Sep 17 00:00:00 2001 From: Signynt <67801159+Signynt@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:05:32 +0100 Subject: [PATCH] Moved styling into CSS --- main.ts | 6 +----- styles.css | 9 +++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.ts b/main.ts index 434cc69..bbd4b56 100644 --- a/main.ts +++ b/main.ts @@ -99,7 +99,6 @@ export default class VirtualFooterPlugin extends Plugin { // Create and inject new footer as a widget below the editor const footerDiv = document.createElement('div'); footerDiv.className = 'virtual-footer'; - footerDiv.style.minHeight = '528px'; await MarkdownRenderer.render( this.app, @@ -206,7 +205,6 @@ class VirtualFooterSettingTab extends PluginSettingTab { const deleteButton = document.createElement('button'); deleteButton.textContent = 'Delete Rule'; - deleteButton.style.margin = '1em'; deleteButton.addEventListener('click', async () => { this.plugin.settings.rules.splice(index, 1); await this.plugin.saveSettings(); @@ -216,15 +214,13 @@ class VirtualFooterSettingTab extends PluginSettingTab { // Add a visual divider const divider = document.createElement('hr'); - divider.style.margin = '1em 0'; ruleDiv.appendChild(divider); }); }; const addButton = document.createElement('button'); + addButton.classList.add('virtual-footer-add-button'); addButton.textContent = 'Add Rule'; - addButton.style.margin = '1em'; - addButton.style.float = 'right'; addButton.addEventListener('click', async () => { this.plugin.settings.rules.push({ folderPath: '', footerText: '' }); await this.plugin.saveSettings(); diff --git a/styles.css b/styles.css index 50b7b58..0c0b378 100644 --- a/styles.css +++ b/styles.css @@ -11,3 +11,12 @@ .virtual-footer-remove-flex { flex: 0 1 auto !important; } + +.virtual-footer { + min-height: 528px; +} + +.virtual-footer-add-button { + margin: 1em; + float: right; +} \ No newline at end of file