/* go beyond the line width */ /* .markdown-reading-view img, .markdown-source-view img, .internal-embed.image-embed { max-width: 100%; height: auto; } */ /* Preserve image dimensions - with consideration for Image Gallery plugin*/ /* .markdown-reading-view img[style*="width"]:not(.grid-item img), .markdown-source-view img[style*="width"]:not(.grid-item img) { height: auto !important; } */ /* --- Image Converter Settings --- */ /* Failsafe: when native image selection is disabled, keep Obsidian's default * Live Preview image focus affordances hidden even if focus slips through for a frame. */ body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .image-embed:focus-within, body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .internal-embed.image-embed:focus-within { outline: none !important; box-shadow: none !important; } body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .image-embed:focus-within .edit-block-button, body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .internal-embed.image-embed:focus-within .edit-block-button { opacity: 0 !important; pointer-events: none !important; } /* Obsidian 1.13 moved image controls into an always-present toolbar that is * revealed on hover. Hide the whole native toolbar so it cannot overlap the * plugin's resize handles or receive pointer input. */ body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .image-embed .embed-actions, body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .internal-embed.image-embed .embed-actions { display: none !important; pointer-events: none !important; } /* The native image-reveal tooltip is absolutely positioned and escapes Obsidian's * fixed-height table row. The Markdown link is the useful part of edit mode here. */ body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .cm-table-widget .cm-image-reveal-tooltip { display: none !important; pointer-events: none !important; } body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .image-embed .image-wrapper::after, body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .internal-embed.image-embed .image-wrapper::after { content: none !important; box-shadow: none !important; } body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .image-embed .image-resize-corner, body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .internal-embed.image-embed .image-resize-corner { opacity: 0 !important; pointer-events: none !important; } body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .image-embed:focus-within .image-resize-corner::after, body.image-converter-disable-native-image-selection:not(.is-mobile) .markdown-source-view .internal-embed.image-embed:focus-within .image-resize-corner::after { opacity: 0 !important; } /* Remove X icon and get use all available space*/ .image-converter-settings-tab { padding: 20px; position: relative; /* Relative positioning for child elements */ height: 100%; /* Occupy full height */ overflow: auto; /* Enable scrolling if content overflows */ scrollbar-gutter: stable; /* Reserve space for scrollbar to prevent content jumping when it appears/disappears */ } /* * Reset Obsidian 1.11+ default .setting-item backgrounds * Obsidian 1.11 introduced default backgrounds on setting-item elements. * This reset ensures all settings within the plugin's tab have transparent backgrounds. */ .image-converter-settings-tab .setting-item { background: transparent; margin-bottom: 0; padding: var(--size-4-3); } /* ------------------- Tabs ------------------------------ */ .image-converter-setting-tabs { display: flex; margin-bottom: 15px; border-bottom: 1px solid var(--background-modifier-border); justify-content: center; overflow-x: auto; /* Horizontal scrolling for many tabs */ } .image-converter-setting-tabs::-webkit-scrollbar { display: none; /* Hide scrollbar */ } .image-converter-tab { padding: 8px 12px; margin-right: 5px; margin-bottom: -1px; /* Overlap the bottom border slightly */ border: 1px solid transparent; border-radius: 5px 5px 0 0; /* Rounded corners at the top */ cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: var(--font-adaptive-normal); transition: background-color 0.1s ease-in-out; /* Smooth hover effect */ border-bottom: 3px solid transparent; } /* Remove left margin for the first tab */ .image-converter-tab:first-child { margin-left: 0; } /* Remove right margin for the last tab */ .image-converter-tab:last-child { margin-right: 0; } .image-converter-tab:hover { /* Remove background color on hover */ /* background-color: var(--background-modifier-hover); */ /* Add underline on hover */ border-bottom-color: var(--interactive-accent); /* Use an accent color for the underline */ } /* Active tab styling */ .image-converter-tab-active { /* Remove background color */ /* border-color: var(--background-modifier-border); */ /* border-bottom-color: var(--background-primary); */ /* background-color: var(--background-primary); */ font-weight: 600; /* Add underline for active tab */ border-bottom-color: var(--interactive-accent); /* Match the hover underline color */ } .image-converter-tab > svg { width: 1.2em; height: 1.2em; margin-right: 6px; stroke-width: 1.5; } /* Tab label text - inherits from parent, selector kept for potential future use */ /* ------------------- Preset Group --------------------- */ .image-converter-preset-group { margin-bottom: 20px; position: relative; /* For absolute positioning of child elements */ z-index: 1; /* Ensure preset group is above other elements */ transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease; transform-origin: top center; transform: scale(1); /* Initially no scaling */ filter: brightness(1) blur(0); /* No initial filter */ opacity: 1; /* Fully opaque */ } .image-converter-preset-group-title { margin-bottom: 15px; font-size: 1.2em; font-weight: 600; border-bottom: 2px solid var(--background-modifier-border); padding-bottom: 5px; display: none; /* HIDDEN - Remove this to show titles */ } .image-converter-preset-group-description { font-size: var(--font-ui-smaller); color: var(--text-muted); margin-bottom: 1em; } /* ---------------------- Preset Card ------------------------------- */ .image-converter-preset-card { border: 1px solid var(--background-modifier-border); border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Subtle shadow */ padding: 14px 20px; display: flex; flex-direction: column; background-color: var(--background-primary); height: auto; transition: opacity 0.3s ease; overflow: hidden; /* Prevent content from spilling out */ } /* "Grabbing" cursor when dragging */ .image-converter-preset-card:active { cursor: grabbing; } /* Pointer cursor for non-add-new cards */ .image-converter-preset-card:not(.image-converter-add-new-preset) { cursor: pointer; } .image-converter-preset-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; margin-top: 0; cursor: move; /* Indicate draggable */ } .image-converter-preset-card-title { font-size: calc(var(--font-ui-small) + 1px); font-weight: 600; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; /* Add ellipsis (...) for long titles */ white-space: nowrap; } /* --- Button Styling --- */ .image-converter-preset-card-actions { display: flex; gap: 2px; margin-right: -16px; } .image-converter-preset-card-actions .clickable-icon { color: var(--text-muted); transition: color 0.2s ease; } .image-converter-preset-card-actions .clickable-icon:hover { color: var(--text-accent); } /* --- Danger Button (e.g., DELETE) --- */ .image-converter-preset-card-actions .danger { color: var(--text-error); } /* --- SortableJS Ghost Styling --- */ .image-converter-sortable-ghost { opacity: 0.5; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } .image-converter-preset-card-body { color: var(--text-mute); font-size: 0.75em; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: wrap; margin-top: 0; } .image-converter-preset-card-body p { margin-block-start: 0; margin-block-end: 0; line-height: 1.4; } /* --- Preset Cards Grid --- */ .image-converter-preset-cards { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid */ cursor: grab; /* Indicate draggable */ } /* Media Query for 3-column layout on larger screens */ @media (min-width: 1000px) { .image-converter-preset-cards { grid-template-columns: repeat(3, 1fr); } } /* --- Active and Default Preset Styling --- */ .image-converter-active-preset { border-color: var(--interactive-accent); box-shadow: 0 0 5px var(--interactive-accent); } .image-converter-default-preset { background-color: var(--background-modifier-hover); } /* --- Custom Variables for Default Preset Background --- */ :root { --image-converter-default-bg: #f5f5f5; /* Light mode default */ } html[data-theme="dark"] { --image-converter-default-bg: #2b2b2b; /* Dark mode default */ } /* ----------------------------- Preset Form ------------ */ .image-converter-preset-form { display: flex; flex-direction: column; /* gap: 10px; */ } .image-converter-form-buttons { display: flex; justify-content: flex-end; /* Align buttons to the right */ gap: 10px; margin-top: 10px; } /* ------------------- Add New Preset Card --------------- */ .image-converter-add-new-preset { display: flex; justify-content: center; align-items: center; border: 1px dashed var(--background-modifier-border); min-height: 100px; height: 100%; cursor: pointer; transition: background-color 0.2s ease; text-align: center; } .image-converter-add-new-preset:hover { background-color: var(--background-modifier-hover); } .image-converter-add-new-preset-text { font-weight: 500; color: var(--text-accent); } /* ----------- Modal Styling --------------------------*/ /* Obsidian 1.11+ sets padding-top/bottom: 0 on modal .setting-item elements. * Match exact DOM structure with child combinator for maximum specificity. */ .modal-content.process-single-image-modal > .conversion-settings-container, .modal-content.process-single-image-modal > .resize-settings-container, .modal-content.process-single-image-modal > .process-single-image-modal-buttons { padding: 5px; } /* Restore pre-1.11 setting-item spacing inside plugin modals */ .modal:not(.mod-settings) .process-single-image-modal .setting-item, .modal:not(.mod-settings) .image-convert-modal .setting-item { padding-top: var(--size-4-2, 0.75em); padding-bottom: var(--size-4-2, 0.75em); } .modal:not(.mod-settings) .process-single-image-modal .setting-item:not(.setting-item-heading):last-child, .modal:not(.mod-settings) .image-convert-modal .setting-item:not(.setting-item-heading):last-child { padding-bottom: var(--size-4-2, 0.75em); } .image-converter-confirm-modal-buttons { display: flex; justify-content: flex-end; gap: 0.5em; margin-top: 1em; } .image-converter-confirm-detail { margin-bottom: 0.25em; } /* --------- GLOBAL PRESET ------------------------------ */ .image-converter-global-preset-container { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; cursor: pointer; } .image-converter-global-preset-container .image-converter-global-preset-title { width: 135px; } /* --- Dropdown --- */ .image-converter-global-preset-container .setting-item { display: flex; flex-direction: row; /* Obsidian 1.11+ changed default to column */ align-items: center; gap: 10px; flex: 1 1 auto; /* Allow growing but can shrink */ border-top: none; min-width: 112px; padding: 0; /* Reset Obsidian 1.11+ default padding */ margin: 0; /* Reset any margin */ } .image-converter-global-preset-container .settings-section-title { margin-left: 0.5em; margin-bottom: 0; font-weight: 600; width: 130px; flex-shrink: 0; /* Prevent shrinking */ line-height: 1; /* Consistent line height */ } /* Hide empty .setting-item-name in this context */ .image-converter-global-preset-container .setting-item-name { display: none; } /* Ensure proper vertical alignment with buttons (Obsidian 1.11+ compatibility) */ .image-converter-global-preset-container .setting-item-info { flex: 1 1 auto; /* Allow info to grow and fill space */ display: flex; flex-direction: row; /* Force row layout */ align-items: center; padding: 0; margin: 0; } .image-converter-global-preset-container .setting-item-description { margin: 0; padding: 0; line-height: 1; /* Match other elements */ } .image-converter-global-preset-container .setting-item-control { flex: 0 0 auto; display: flex; align-items: center; margin-left: auto; /* Push dropdown toward the end */ padding: 0; } /* Ensure + button stays close to dropdown */ .image-converter-global-preset-container > button { flex: 0 0 auto; margin-left: 0; /* No extra margin, rely on gap */ } /* --- Clickable Toggle Area --- */ .image-converter-global-preset-toggle { display: flex; align-items: center; margin-right: 10px; font-weight: 600; } .image-converter-chevron-icon { margin-right: 5px; transition: transform 0.2s ease; } /* Rotate chevron when collapsed */ .image-converter-settings-tab:not(.global-presets-visible) .image-converter-chevron-icon { transform: rotate(-90deg); } /* --------------- IMAGE ALIGNMENT SETTINGS ------------------------------ */ /* ----------------------------------------------------------------------- */ /* --- Section Container --- */ .image-converter-settings-tab .image-alignment-settings-section { display: flex; /* align-items: center; */ /* gap: 10px; */ /* margin-bottom: 10px; */ cursor: pointer; flex-direction: column; } /* --- Section Header (Clickable Toggle Area) --- */ .image-converter-settings-tab .image-alignment-settings-section .settings-section-header { display: flex; align-items: center; justify-content: space-between; width: 100%; /* padding: 8px 0; */ } .image-converter-settings-tab .image-alignment-settings-section .settings-section-title { /* flex-grow: 1; */ margin-left: 0.5em; font-weight: 600; margin-bottom: 5px; } .image-converter-settings-tab .image-alignment-settings-section .settings-section-toggle-button { margin-left: auto; margin-right: 0; } /* --- Chevron Icon --- */ .image-converter-settings-tab .image-alignment-settings-section .settings-section-chevron-icon { margin-right: 5px; transition: transform 0.2s ease; } /* --- HIDE CHEVRON WHEN IMAGE ALIGNMENT IS DISABLED --- */ .image-converter-settings-tab .image-alignment-settings-section:not(.image-alignment-enabled) .settings-section-chevron-icon { /* Refined selector */ display: none; /* Hide chevron when image alignment section is disabled */ } /* --- Indentation for Settings within Section --- */ .image-converter-settings-tab .image-alignment-settings-section .setting-item { padding-left: 1.5em; border-top: none; margin-top: 0 !important; margin-bottom: 0 !important; } /* --- Hide Settings when Section is Collapsed --- */ .image-converter-settings-tab .image-alignment-settings-section.settings-section-collapsed > *:not(.settings-section-header) { display: none; } .settings-section-clarification-text { margin-left: 19px; color: var(--text-muted); font-size: var(--font-ui-smaller); padding-top: var(--size-4-1); line-height: var(--line-height-tight); } /* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */ /* --------- Image Drag & Resize Settings Section --------- */ /* --- Main Container --- */ .image-drag-resize-settings-section { display: flex; /* align-items: center; */ /* gap: 10px; */ /* margin-bottom: 10px; */ cursor: pointer; flex-direction: column; } /* --- Collapsible Section Header --- */ .image-drag-resize-settings-section .settings-section-header { display: flex; align-items: center; justify-content: space-between; width: 100%; /* padding: 8px 0; */ } /* --- Section Title --- */ .image-drag-resize-settings-section .settings-section-title { /* flex-grow: 1; */ margin-left: 0.5em; margin-bottom: 5px; font-weight: 600; } /* --- Toggle Switch --- */ .image-drag-resize-settings-section .settings-section-toggle-button { margin-left: auto; margin-right: 0; } /* --- Chevron Icon --- */ .image-drag-resize-settings-section .settings-section-chevron-icon { margin-right: 5px; transition: transform 0.2s ease; } /* --- HIDE CHEVRON WHEN IMAGE ALIGNMENT IS DISABLED --- */ .image-converter-settings-tab .image-drag-resize-settings-section:not(.image-drag-resize-enabled) .settings-section-chevron-icon { /* Refined selector */ display: none; /* Hide chevron when image alignment section is disabled */ } /* --- Indentation for Settings within Section --- */ .image-converter-settings-tab .image-drag-resize-settings-section .setting-item { padding-left: 1.5em; border-top: none; margin-top: 0 !important; margin-bottom: 0 !important; } /* --- Hide Settings when Section is Collapsed --- */ .image-converter-settings-tab .image-drag-resize-settings-section.settings-section-collapsed > *:not(.settings-section-header) { display: none; } /* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */ /* --- Hide Tabs and Content --- */ /* Hide tabs and preset groups when global presets are not visible */ .image-converter-settings-tab:not(.global-presets-visible) .image-converter-setting-tabs, .image-converter-settings-tab:not(.global-presets-visible) .image-converter-tab-content-wrapper { display: none; } /* ------- Preset Summary in Modal ----------------------*/ .image-converter-preset-summary { margin-top: 10px; } .image-converter-preset-summary .summary-section { margin-bottom: 15px; } .image-converter-preset-summary .summary-section-title { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } .image-converter-preset-summary .summary-item { margin-left: 20px; margin-bottom: 3px; } .image-converter-preset-summary .summary-label { font-weight: 600; } .image-converter-preset-summary .summary-value { font-style: italic; } .image-converter-preset-summary .summary-value-bold { font-weight: bold; } .image-converter-summary-example { font-style: italic; } /* --------------------------- Form Container ----------- */ .image-converter-form-container { margin-top: 20px; padding: 20px; border: 1px solid var(--background-modifier-border); border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); background-color: var(--background-primary); display: none; z-index: 2; /* Ensure form is above preset group */ position: relative; } /* Class to make the form container visible */ .image-converter-form-container.visible { display: block; border: var(--interactive-accent); box-shadow: 0 0 5px var(--interactive-accent); animation: slideDown 0.3s ease forwards; } /* --- Responsive Design --- */ @media (max-width: 600px) { .image-converter-available-variables-modal { width: 95vw; } .image-converter-available-variables-modal th, .image-converter-available-variables-modal td { font-size: 0.9em; padding: 8px; } } /* --- Animation --- */ @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } /* ------------- VARIABLES Modal -----------------------*/ .image-converter-available-variables-modal { width: 90vw; max-width: 800px; } .image-converter-available-variables-modal .modal-content { padding: 0px; /* Remove padding */ } .image-converter-available-variables-modal .modal-title { margin-bottom: 20px; font-size: 1.4em; font-weight: 600; } .image-converter-available-variables-modal h4 { margin-top: 20px; margin-bottom: 10px; font-size: 1.2em; font-weight: 600; color: var(--text-normal); } .image-converter-available-variables-modal table { width: 100%; border-collapse: collapse; } .image-converter-available-variables-modal th, .image-converter-available-variables-modal td { border: 1px solid var(--background-modifier-border); padding: 10px; text-align: left; font-size: 0.95em; vertical-align: top; } .image-converter-available-variables-modal th { background-color: var(--background-secondary); font-weight: 600; } .image-converter-available-variables-modal td:first-child { font-family: monospace; font-weight: 600; color: var(--text-accent); white-space: nowrap; cursor: pointer; transition: all 0.15s ease; } .image-converter-available-variables-modal td:first-child:hover { background-color: var(--background-modifier-hover); } /* .image-converter-available-variables-modal td:nth-child(2) - width adjustable as needed */ .image-converter-available-variables-modal td:last-child { font-family: monospace; color: var(--text-muted); } /* Variable copy feedback animations */ .variable-name-copied { background-color: var(--interactive-accent) !important; color: var(--text-on-accent) !important; transform: scale(1.05) !important; } .variable-name-copy-error { background-color: var(--background-modifier-error) !important; color: var(--text-error) !important; } /* --- Encoder detection success styling --- */ .image-converter-encoder-highlight { color: var(--color-green); } /* --- Shared icon button styling --- */ .image-converter-icon-button { margin-right: 8px; min-width: 26px; padding: 0 6px; } .image-converter-setting-info-icon { display: inline-flex; align-items: center; justify-content: center; margin-left: 0.35em; color: var(--text-muted); vertical-align: text-bottom; line-height: 1; flex: none; cursor: help; } .image-converter-setting-info-icon svg { width: 0.9em; height: 0.9em; stroke-width: 2; } /* --- Encoder detection success styling (green state) --- */ button.image-converter-encoder-detected, .image-converter-encoder-detected.button, .image-converter-encoder-detected.mod-cta { background-color: var(--color-green); border-color: var(--color-green); color: var(--text-on-accent); } button.image-converter-encoder-detected:hover, .image-converter-encoder-detected.button:hover, .image-converter-encoder-detected.mod-cta:hover { background-color: var(--color-green); border-color: var(--color-green); filter: brightness(1.05); } /* -------------- Link FORMATS --------------------- */ .image-converter-format-examples-section { margin-top: 20px; margin-bottom: 20px; border: 1px solid var(--background-modifier-border); border-radius: 6px; } /* --- Summary (Clickable Part) --- */ .image-converter-format-examples-section summary { padding: 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); user-select: none; list-style: none; /* Remove default list-style */ } .image-converter-format-examples-section summary::-webkit-details-marker { display: none; /* Remove default WebKit marker */ } .image-converter-format-examples-section summary:hover { background-color: var(--background-secondary); } /* --- Arrow --- */ .image-converter-format-examples-section summary::after { content: "▼"; /* Downward arrow */ transition: transform 0.2s ease; transform-origin: center; font-size: 0.8em; margin-left: 5px; display: inline-block; } /* Rotate arrow when details is open */ .image-converter-format-examples-section[open] summary::after { transform: rotate(90deg); } /* --- Content --- */ .image-converter-format-examples-content { padding: 10px; border-top: 1px solid var(--background-modifier-border); } .image-converter-format-examples-table { width: 100%; margin-top: 10px; border-collapse: collapse; } .image-converter-format-label, .image-converter-format-example, .image-converter-format-description { border: 1px solid var(--background-modifier-border); padding: 8px; text-align: left; vertical-align: middle; } .image-converter-format-label { font-weight: bold; width: 15%; } .image-converter-format-description { width: 60%; } /* Styling for the