fix: pointer cursor on clickables, 'No icon' is a real button
styles.css used cursor: var(--cursor) in 10 places and the icon modal in 2 more. Obsidian defines --cursor as 'default', so nothing in the plugin ever showed a pointer — the old 'correct cursor on hover' todo never actually worked. Use var(--cursor-link, pointer): themeable, pointer by default. cursor: grab on separators/spacers is left alone. 'No icon' was a bare accent-coloured span in the status row. It commits a value and closes, exactly like Save, so it is now a real button in the modal button container, left-aligned via margin-right: auto to read as a secondary action. Also adds the missing trailing newline to styles.css.
This commit is contained in:
+10
-10
@@ -1228,15 +1228,6 @@ class IconSuggestModal extends Modal {
|
||||
const statusEl = statusRow.createSpan();
|
||||
statusEl.setText('Loading\u2026');
|
||||
|
||||
const clearEl = statusRow.createSpan();
|
||||
clearEl.style.cursor = 'var(--cursor)';
|
||||
clearEl.style.color = 'var(--text-accent)';
|
||||
clearEl.setText('No icon');
|
||||
clearEl.addEventListener('click', () => {
|
||||
this.onSubmit('');
|
||||
this.close();
|
||||
});
|
||||
|
||||
// ── Load icons ──
|
||||
this.loadIcons().then(() => {
|
||||
this.loaded = true;
|
||||
@@ -1279,7 +1270,7 @@ class IconSuggestModal extends Modal {
|
||||
tile.style.justifyContent = 'center';
|
||||
tile.style.aspectRatio = '1';
|
||||
tile.style.borderRadius = '6px';
|
||||
tile.style.cursor = 'var(--cursor)';
|
||||
tile.style.cursor = 'var(--cursor-link, pointer)';
|
||||
tile.style.transition = 'background 80ms';
|
||||
tile.setAttr('title', name);
|
||||
|
||||
@@ -1334,6 +1325,15 @@ class IconSuggestModal extends Modal {
|
||||
|
||||
// ── Buttons ──
|
||||
const btns = modal.createDiv({ cls: 'modal-button-container' });
|
||||
|
||||
// Clearing the icon commits a value and closes, exactly like Save, so it
|
||||
// belongs with the buttons rather than as a bare span in the status row.
|
||||
const clearBtn = btns.createEl('button', { text: 'No icon', cls: 'waypoint-icon-clear' });
|
||||
clearBtn.addEventListener('click', () => {
|
||||
this.onSubmit('');
|
||||
this.close();
|
||||
});
|
||||
|
||||
const cancel = btns.createEl('button', { text: 'Cancel' });
|
||||
cancel.addEventListener('click', () => this.close());
|
||||
const saveBtn = btns.createEl('button', { text: 'Save', cls: 'mod-cta' });
|
||||
|
||||
Reference in New Issue
Block a user