File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
apps/vps-web/src/app/custom-nodes/classes Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,20 @@ import { BaseRectNode } from './rect-node-class';
99
1010import './style.css' ;
1111
12+ class Label extends HTMLElement {
13+ constructor ( ) {
14+ super ( ) ;
15+ const shadow = this . attachShadow ( { mode : 'open' } ) ;
16+ const wrapper = document . createElement ( 'label' ) ;
17+ wrapper . setAttribute ( 'part' , 'label' ) ; // uses ::part pseudo-element
18+ const text = this . getAttribute ( 'text' ) || 'Label' ;
19+ wrapper . textContent = text ;
20+ shadow . appendChild ( wrapper ) ;
21+ }
22+ }
23+
24+ customElements . define ( 'draw-grid-label' , Label ) ;
25+
1226interface GridDrawSettings {
1327 fadeRadius : number ;
1428 fadePower : number ;
@@ -132,6 +146,7 @@ class GridDraw {
132146 controlsContainer . className = 'controls-container' ;
133147 controlsContainer . innerHTML = `
134148 <div class="control-group">
149+ <draw-grid-label text="Draw Grid"></draw-grid-label>
135150 <label>Brush Color</label>
136151 <input type="color" id="colorPicker" value="#000000">
137152 <div class="color-presets">
Original file line number Diff line number Diff line change 194194 right : 50% ;
195195 transform : translate (50% , -50% );
196196}
197+
198+ draw-grid-label ::part (label ) {
199+ @apply text-black mb-5;
200+ }
You can’t perform that action at this time.
0 commit comments