Skip to content

Commit cea0e9a

Browse files
committed
CSS fixing
1 parent 0ec6ab8 commit cea0e9a

File tree

3 files changed

+48
-12
lines changed

3 files changed

+48
-12
lines changed

Chrome/popup.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ document.addEventListener("DOMContentLoaded", async () => {
100100
item.className = "script-item";
101101
item.dataset.id = index;
102102

103+
// Icon
104+
if (script.icon) {
105+
const iconImg = document.createElement("img");
106+
iconImg.src = script.icon;
107+
iconImg.alt = "";
108+
iconImg.className = "script-icon";
109+
iconImg.onerror = () => iconImg.remove();
110+
item.appendChild(iconImg);
111+
}
112+
103113
const toggleContainer = document.createElement("div");
104114
toggleContainer.className = "script-toggle";
105115

@@ -122,19 +132,11 @@ document.addEventListener("DOMContentLoaded", async () => {
122132
label.appendChild(slider);
123133
toggleContainer.appendChild(label);
124134

135+
item.appendChild(toggleContainer);
136+
125137
const info = document.createElement("div");
126138
info.className = "script-info";
127139

128-
// Icon
129-
if (script.icon) {
130-
const iconImg = document.createElement("img");
131-
iconImg.src = script.icon;
132-
iconImg.alt = "";
133-
iconImg.className = "script-icon";
134-
iconImg.onerror = () => iconImg.remove();
135-
item.appendChild(iconImg);
136-
}
137-
138140
const name = document.createElement("div");
139141
name.className = "script-name";
140142
name.textContent = script.name;
@@ -160,7 +162,6 @@ document.addEventListener("DOMContentLoaded", async () => {
160162
chrome.tabs.create({ url: `editor.html?id=${script.id}` });
161163
});
162164

163-
item.appendChild(toggleContainer);
164165
item.appendChild(info);
165166

166167
if (script.enabled === false) {

Chrome/styles/dashboard.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,31 @@ tbody tr:hover {
313313
background: var(--primary-light);
314314
}
315315

316+
/* Action Buttons */
317+
.script-actions {
318+
white-space: nowrap;
319+
}
320+
321+
.script-actions .icon-button {
322+
display: inline-flex;
323+
align-items: center;
324+
justify-content: center;
325+
margin-right: var(--space-xs);
326+
flex-shrink: 0;
327+
}
328+
329+
.script-actions .icon-button:last-child {
330+
margin-right: 0;
331+
}
332+
333+
.action-icon {
334+
width: var(--space-md);
335+
height: var(--space-md);
336+
stroke: currentColor;
337+
stroke-width: 2;
338+
fill: none;
339+
}
340+
316341
/* Toggle Switch */
317342
.toggle-switch {
318343
position: relative;

Chrome/styles/popup.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ button.primary:hover {
161161
/* Compact Script Items */
162162
.script-item {
163163
display: flex;
164-
justify-content: space-between;
165164
align-items: center;
166165
padding: 8px 10px;
167166
border-radius: 4px;
168167
background-color: var(--bg-secondary);
169168
position: relative;
170169
border: 1px solid var(--border-primary);
171170
transition: var(--transition-all);
171+
gap: 8px;
172172
}
173173

174174
.script-item:hover {
@@ -219,6 +219,16 @@ button.primary:hover {
219219
font-family: var(--font-mono);
220220
}
221221

222+
/* Script Icon Styling */
223+
.script-icon {
224+
width: 16px;
225+
height: 16px;
226+
object-fit: contain;
227+
border-radius: 2px;
228+
margin-right: 8px;
229+
flex-shrink: 0;
230+
}
231+
222232
/* Compact Toggle Switch */
223233
.script-toggle {
224234
flex-shrink: 0;

0 commit comments

Comments
 (0)