Last active
November 26, 2025 19:34
-
-
Save jcfranco/51323a8fcee6e291257bd4be9dfa54ab to your computer and use it in GitHub Desktop.
Bookmarklet for creating a basic Calcite Components codepen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function () { | |
| const versionInput = prompt("Calcite version (leave blank for @latest):", ""); | |
| const calciteVersion = versionInput && versionInput.trim() ? versionInput.trim() : "latest"; | |
| const scriptTag = `<script type="module" src="https://cdn.jsdelivr.net/npm/@esri/calcite-components@${calciteVersion}/dist/cdn/index.js"></script>`; | |
| const data = { | |
| title: `[calcite-components]`, | |
| html: scriptTag, | |
| css: "", | |
| js: "", | |
| js_external: "" | |
| }; | |
| const form = document.createElement("form"); | |
| form.method = "POST"; | |
| form.action = "https://codepen.io/pen/define"; | |
| form.target = "_blank"; | |
| const input = document.createElement("input"); | |
| input.type = "hidden"; | |
| input.name = "data"; | |
| input.value = JSON.stringify(data); | |
| form.appendChild(input); | |
| document.body.appendChild(form); | |
| form.submit(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment