@@ -74,19 +74,8 @@ export class NodeTagSuggestPopover {
7474
7575 private createPopover ( ) : HTMLElement {
7676 const popover = document . createElement ( "div" ) ;
77- popover . className = "node-tag-suggest-popover" ;
78- popover . style . cssText = `
79- position: fixed;
80- z-index: 10000;
81- background: var(--background-primary);
82- border: 1px solid var(--background-modifier-border);
83- border-radius: 6px;
84- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
85- max-height: 300px;
86- overflow-y: auto;
87- min-width: 200px;
88- max-width: 400px;
89- ` ;
77+ popover . className =
78+ "node-tag-suggest-popover fixed z-[10000] bg-primary border border-modifier-border rounded-md shadow-[0_4px_12px_rgba(0,0,0,0.15)] max-h-[300px] overflow-y-auto min-w-[200px] max-w-[400px]" ;
9079
9180 const itemsContainer = document . createElement ( "div" ) ;
9281 itemsContainer . className = "node-tag-items-container" ;
@@ -102,68 +91,36 @@ export class NodeTagSuggestPopover {
10291
10392 if ( this . items . length === 0 ) {
10493 const noResults = document . createElement ( "div" ) ;
105- noResults . style . cssText = `
106- padding: 12px;
107- text-align: center;
108- color: var(--text-muted);
109- font-size: 14px;
110- ` ;
94+ noResults . className = "p-3 text-center text-muted text-sm" ;
11195 noResults . textContent = "No node tags available" ;
11296 container . appendChild ( noResults ) ;
11397 return ;
11498 }
11599
116100 this . items . forEach ( ( item , index ) => {
117101 const itemEl = document . createElement ( "div" ) ;
118- itemEl . className = "node-tag-item" ;
102+ itemEl . className = `node-tag-item px-3 py-2 cursor-pointer flex items-center gap-2 border-b border-[var(--background-modifier-border-hover)]${
103+ index === this . selectedIndex ? " bg-modifier-hover" : ""
104+ } `;
119105 itemEl . dataset . index = index . toString ( ) ;
120- itemEl . style . cssText = `
121- padding: 8px 12px;
122- cursor: pointer;
123- display: flex;
124- align-items: center;
125- gap: 8px;
126- border-bottom: 1px solid var(--background-modifier-border-hover);
127- ` ;
128-
129- if ( index === this . selectedIndex ) {
130- itemEl . style . backgroundColor = "var(--background-modifier-hover)" ;
131- }
132106
133107 if ( item . nodeType . color ) {
134108 const colorDot = document . createElement ( "div" ) ;
135- colorDot . style . cssText = `
136- width: 12px;
137- height: 12px;
138- border-radius: 50%;
139- background-color: ${ item . nodeType . color } ;
140- flex-shrink: 0;
141- ` ;
109+ colorDot . className = `w-3 h-3 rounded-full shrink-0` ;
110+ colorDot . style . backgroundColor = item . nodeType . color ;
142111 itemEl . appendChild ( colorDot ) ;
143112 }
144113
145114 const textContainer = document . createElement ( "div" ) ;
146- textContainer . style . cssText = `
147- display: flex;
148- flex-direction: column;
149- gap: 2px;
150- flex: 1;
151- ` ;
115+ textContainer . className = "flex flex-col gap-0.5 flex-1" ;
152116
153117 const tagText = document . createElement ( "div" ) ;
154118 tagText . textContent = `#${ item . tag } ` ;
155- tagText . style . cssText = `
156- font-weight: 500;
157- color: var(--text-normal);
158- font-size: 14px;
159- ` ;
119+ tagText . className = "font-medium text-normal text-sm" ;
160120
161121 const nodeTypeText = document . createElement ( "div" ) ;
162122 nodeTypeText . textContent = item . nodeType . name ;
163- nodeTypeText . style . cssText = `
164- font-size: 12px;
165- color: var(--text-muted);
166- ` ;
123+ nodeTypeText . className = "text-xs text-muted" ;
167124
168125 textContainer . appendChild ( tagText ) ;
169126 textContainer . appendChild ( nodeTypeText ) ;
@@ -190,7 +147,7 @@ export class NodeTagSuggestPopover {
190147 `.node-tag-item[data-index="${ this . selectedIndex } "]` ,
191148 ) as HTMLElement ;
192149 if ( prevSelected ) {
193- prevSelected . style . backgroundColor = "" ;
150+ prevSelected . classList . remove ( "bg-modifier-hover" ) ;
194151 }
195152
196153 this . selectedIndex = newIndex ;
@@ -199,7 +156,7 @@ export class NodeTagSuggestPopover {
199156 `.node-tag-item[data-index="${ this . selectedIndex } "]` ,
200157 ) as HTMLElement ;
201158 if ( newSelected ) {
202- newSelected . style . backgroundColor = "var(--background- modifier-hover)" ;
159+ newSelected . classList . add ( "bg- modifier-hover" ) ;
203160 }
204161 }
205162
0 commit comments