Skip to content

Instantly share code, notes, and snippets.

@shahnhogan
Last active December 23, 2023 01:40
Show Gist options
  • Save shahnhogan/b05f819905abc1488b7d693d1eae2c74 to your computer and use it in GitHub Desktop.
Save shahnhogan/b05f819905abc1488b7d693d1eae2c74 to your computer and use it in GitHub Desktop.
Elm Debugger - nudge the debugger over when multiple Elm apps are on the same page
const elmDebuggers = document.querySelectorAll('[viewBox="-300 -300 600 600"]');
Array.from(elmDebuggers).forEach((elmDebugger, index) => {
const nudgeAmount = `${1.5 + 6 * index}rem`;
elmDebugger.parentNode.style.right = nudgeAmount;
});
// Thanks to https://github.com/lucamug for sharing this on Twitter
// Original thread -- https://x.com/luca_mug/status/1737954346745401590?s=20
// @luca_mug example code: https://x.com/luca_mug/status/1738077153277931961?s=20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment