Created
April 26, 2026 18:09
-
-
Save onespaceman/4169a28dbc4d43aed605cd85485d8d0f to your computer and use it in GitHub Desktop.
shadowdom panel example
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
| command.define { | |
| name = "TEST PANEL: OPEN", | |
| run = function(args) showPanel() end | |
| } | |
| function showPanel() | |
| local panel = dom.div { id = "panel-content" } | |
| -- implement script in lua like this -> | |
| panel.onclick = function() panel.textContent = panel.textContent .. "\n Clicked on panel from lua" end | |
| local styles = dom.style {} | |
| styles.textContent = [[ | |
| #panel-content { | |
| height: 100vh; | |
| background: darkgreen; | |
| white-space: pre-wrap; | |
| } | |
| ]] | |
| editor.showPanel("lhs", 0.5, { styles, panel }) -- <- pass array of elements which can include style elements | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment