Skip to content

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Sep 30, 2024

This will fix #163 and fix #170 once it's finished.

It makes code blocks more consistent by always wrapping them in a <div class="code-block"> whether or not there's a filename, groups the original JS and the converted TS under it, and renders the checkbox and copy-to-clipboard button in the HTML, rather than mounting them when the app starts.

It makes the JS/TS toggle work without JavaScript, takes less space, and requires a single click/keypress to toggle.

TODO:

  • make it work for .svelte files too
  • persist and synchronise the toggled state when JS is available
  • get the copy-to-clipboard button working again
  • various CSS fixes
  • fix scroll position

Copy link

vercel bot commented Sep 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
omnisite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 2:31am

@Rich-Harris Rich-Harris merged commit 205d791 into main Oct 1, 2024
3 checks passed
@Rich-Harris Rich-Harris deleted the js-ts-toggle branch October 1, 2024 02:34
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.

Show 'copy code' button immediately Make TypeScript/JavaScript selector a toggle
1 participant