Commit fcfdddc
[ENG-1657] Update styling and behavior of convert-to-node button on image embeds (#991)
* Update styling and behavior of convert-to-node button on image embeds
- Show button on click instead of hover, matching Obsidian's native "edit this block" behavior
- Increase button size from 26px to 28px to match native embed action buttons
- Add outside-click handler to dismiss the button
- Clean up show/hide into dedicated helper functions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Replace inline styles with CSS classes for convert-to-node button
Move button show/hide state and base styles out of style.cssText and
direct style property assignments into stylesheet classes, per the
no-inline-styles rule.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Simplify button visibility to single CSS descendant selector
Remove ICON_VISIBLE_CLASS — toggle EMBED_ACTIVE_CLASS on the embed
container and derive button visibility via CSS descendant selector
.dg-image-embed-active .dg-image-convert-icon instead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Move button hidden state from Tailwind to CSS to fix opacity conflict
Tailwind's compiled opacity-0/pointer-events-none could win the cascade
over our descendant selector if it loads later. Moving initial state into
.dg-image-convert-icon in style.css ensures a single source of truth for
button visibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Restore opacity-0 Tailwind class as initial hidden state
The CSS base rule alone isn't reliable until the dist is rebuilt.
Keep opacity-0/pointer-events-none as Tailwind classes for the initial
state — the descendant selector has higher specificity (0,2,0 vs 0,1,0)
so it correctly overrides them when dg-image-embed-active is set.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* graphite comment
* format
* address PR comment
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent d30313a commit fcfdddc
2 files changed
Lines changed: 2363 additions & 2233 deletions
0 commit comments