Skip to content

feat: load visual editing overlay styles with standalone v2 - #1530

Merged
stipsan merged 2 commits into
mainfrom
feat/visual-editing-standalone-v2
Aug 18, 2026
Merged

feat: load visual editing overlay styles with standalone v2#1530
stipsan merged 2 commits into
mainfrom
feat/visual-editing-standalone-v2

Conversation

@stipsan

@stipsan stipsan commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Bump @sanity/visual-editing-standalone to ^2. Standalone v2 no longer injects CSS from JS.
  • Always import styles.css next to enableVisualEditing() in useSanityVisualEditing so overlays keep working (no opt-out, not pushed onto nuxt.options.css).
  • Note in the visual editing docs that overlay styles are included automatically.

Test plan

  • CI: unit tests, types, lint
  • Enable visual editing and confirm overlay styles (spinner / sr-only / ellipsis) still load without a user CSS import
  • mode: 'custom' calling useSanityVisualEditing() also gets the stylesheet

@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for nuxt-sanity-module ready!

Name Link
🔨 Latest commit f50b48a
🔍 Latest deploy log https://app.netlify.com/projects/nuxt-sanity-module/deploys/6a84d877ae417200080a4797
😎 Deploy Preview https://deploy-preview-1530--nuxt-sanity-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxtjs/sanity@1530

commit: f50b48a

Comment thread src/runtime/composables/useSanityVisualEditing.ts Outdated
@stipsan

stipsan commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

declare module '@sanity/visual-editing-standalone/styles.css' can be removed once sanity-io/visual-editing#3630 is released (the package will type that subpath). Left a TODO on the stub.

@stipsan

stipsan commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Dropped the local declare module '@sanity/visual-editing-standalone/styles.css' stub now that @sanity/visual-editing-standalone@2.0.1 ships types for that export.

@sanity/visual-editing-standalone@2 no longer injects CSS, so import
styles.css next to enableVisualEditing() to keep overlay styles loading.

Co-authored-by: Cursor <cursoragent@cursor.com>
@stipsan
stipsan force-pushed the feat/visual-editing-standalone-v2 branch from 04d7e52 to 98e4a7e Compare August 17, 2026 12:14
Keep @sanity/visual-editing-standalone at ^2.0.1 after main landed ^2.0.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
@stipsan
stipsan added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit 4b265e0 Aug 18, 2026
12 checks passed
@stipsan
stipsan deleted the feat/visual-editing-standalone-v2 branch August 18, 2026 22:43
@github-actions github-actions Bot mentioned this pull request Aug 18, 2026
stipsan added a commit that referenced this pull request Aug 18, 2026
Keep private onPerspectiveChange/onVariantChange after #1530 landed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant