|
63 | 63 | .editor-wrap pre{z-index:1;pointer-events:none;background:transparent;color:var(--text)} |
64 | 64 |
|
65 | 65 | /* CSS output (read-only, no overlay needed) */ |
66 | | -.css-wrap{flex:1;min-height:0;overflow:auto;padding:12px;font-family:var(--mono);font-size:12px;line-height:1.6;white-space:pre;word-wrap:normal;color:var(--text)} |
| 66 | +.css-wrap{flex:1;min-height:0;overflow:auto;padding:12px;font-family:var(--mono);font-size:12px;line-height:1.6;white-space:pre;word-wrap:normal;color:var(--text);user-select:text} |
67 | 67 |
|
68 | 68 | /* Syntax highlighting colors */ |
69 | 69 | .hl-punct{color:#6272a4} |
@@ -111,7 +111,7 @@ <h1>Tailwind <span>Compiler</span> — WASM Playground</h1> |
111 | 111 | </div> |
112 | 112 | <div class="panel"> |
113 | 113 | <div class="panel-header"><span>Generated CSS <span class="panel-stats" id="css-stats"></span></span><button class="expand-btn" title="Expand"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg></button></div> |
114 | | - <div class="css-wrap"><code id="css-output"></code></div> |
| 114 | + <div class="css-wrap" tabindex="0"><code id="css-output"></code></div> |
115 | 115 | </div> |
116 | 116 | <div class="panel"> |
117 | 117 | <div class="panel-header"><span>Preview</span><button class="expand-btn" title="Expand"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg></button></div> |
@@ -666,6 +666,18 @@ <h2 class="text-lg font-semibold text-base-content mb-4">Color Palette</h2> |
666 | 666 | pre.scrollLeft = htmlInput.scrollLeft; |
667 | 667 | }); |
668 | 668 |
|
| 669 | +// Scope Cmd+A / Ctrl+A to the CSS pane when it's focused |
| 670 | +cssWrap.addEventListener('keydown', (e) => { |
| 671 | + if ((e.metaKey || e.ctrlKey) && e.key === 'a') { |
| 672 | + e.preventDefault(); |
| 673 | + const range = document.createRange(); |
| 674 | + range.selectNodeContents(cssWrap); |
| 675 | + const sel = window.getSelection(); |
| 676 | + sel.removeAllRanges(); |
| 677 | + sel.addRange(range); |
| 678 | + } |
| 679 | +}); |
| 680 | + |
669 | 681 | preflightCb.addEventListener('change', doCompile); |
670 | 682 | minifyCb.addEventListener('change', doCompile); |
671 | 683 |
|
|
0 commit comments