From 875d773e4db6230a3e3927a2d9e34a003caf66ee Mon Sep 17 00:00:00 2001 From: FBarrca <201800222@alu.comillas.edu> Date: Tue, 7 Jan 2025 12:59:11 +0100 Subject: [PATCH] Refactor settings to use CSS classes for textarea styling --- src/settings.ts | 17 +++++------------ styles.css | 6 ++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index 70c977c..244f6a8 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,4 +1,3 @@ -// MyPluginSettings.ts import { App, PluginSettingTab, Setting } from "obsidian"; import MyPlugin from "./main"; import { cursorPrompt, selectionPrompt } from "./default_prompts"; @@ -34,8 +33,6 @@ export class InlineAISettingsTab extends PluginSettingTab { const { containerEl } = this; containerEl.empty(); - - // Provider setting new Setting(containerEl) .setName("Provider") @@ -86,6 +83,7 @@ export class InlineAISettingsTab extends PluginSettingTab { new Setting(containerEl) .setName("Advanced") .setHeading(); + // Selection Prompt setting new Setting(containerEl) .setName("Selection Prompt") @@ -99,10 +97,8 @@ export class InlineAISettingsTab extends PluginSettingTab { await this.plugin.saveSettings(); }); - // Make the text area wider - textarea.inputEl.style.width = "25em"; - textarea.inputEl.style.height = "10em"; - + // Add a CSS class for styling + textarea.inputEl.classList.add("wide-text-settings"); }); // Cursor Prompt setting @@ -118,11 +114,8 @@ export class InlineAISettingsTab extends PluginSettingTab { await this.plugin.saveSettings(); }); - // Make the text area wider - textarea.inputEl.style.width = "25em"; - textarea.inputEl.style.height = "10em"; - + // Add a CSS class for styling + textarea.inputEl.classList.add("wide-text-settings"); }); - } } diff --git a/styles.css b/styles.css index 2302509..5c9b7d5 100644 --- a/styles.css +++ b/styles.css @@ -111,3 +111,9 @@ .tooltip-button:hover { opacity: 0.8; } + +/* Style for the advanced text areas */ +.wide-text-settings { + width: 25em; + height: 10em; +}