Add reusable icon-grid type selector for CSS source editor
Replaces the plain <select> dropdown with a visual grid popup showing icon, label, and description for each source type. The IconSelect component is generic and reusable for other type selectors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -462,6 +462,124 @@ textarea:focus-visible {
|
||||
padding: 6px 10px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius);
|
||||
background: var(--bg-primary);
|
||||
background: var(--bg-secondary);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* ── Icon Select (reusable type picker) ──────────────────────── */
|
||||
|
||||
.icon-select-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
background: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s;
|
||||
text-align: left;
|
||||
}
|
||||
.icon-select-trigger:hover {
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
.icon-select-trigger-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.icon-select-trigger-icon .icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
.icon-select-trigger-label {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.icon-select-trigger-arrow {
|
||||
flex-shrink: 0;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.5;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.icon-select-popup {
|
||||
position: relative;
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
transition: max-height 0.2s ease, opacity 0.15s ease, margin 0.2s ease;
|
||||
margin-top: 0;
|
||||
}
|
||||
.icon-select-popup.open {
|
||||
max-height: 600px;
|
||||
opacity: 1;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.icon-select-grid {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
padding: 6px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius);
|
||||
background: var(--bg-color);
|
||||
}
|
||||
|
||||
.icon-select-cell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 10px 6px;
|
||||
border: 2px solid transparent;
|
||||
border-radius: var(--radius);
|
||||
background: var(--bg-secondary);
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s, background 0.15s, transform 0.1s;
|
||||
text-align: center;
|
||||
}
|
||||
.icon-select-cell:hover {
|
||||
border-color: var(--primary-color);
|
||||
transform: scale(1.03);
|
||||
}
|
||||
.icon-select-cell.active {
|
||||
border-color: var(--primary-color);
|
||||
background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-secondary));
|
||||
}
|
||||
|
||||
.icon-select-cell-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.icon-select-cell-icon .icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
.icon-select-cell.active .icon-select-cell-icon .icon {
|
||||
stroke: var(--primary-color);
|
||||
}
|
||||
.icon-select-cell-label {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.icon-select-cell-desc {
|
||||
font-size: 0.72rem;
|
||||
opacity: 0.6;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
/* Hide descriptions on narrow screens */
|
||||
@media (max-width: 480px) {
|
||||
.icon-select-cell-desc { display: none; }
|
||||
.icon-select-cell { padding: 8px 4px; }
|
||||
.icon-select-grid { gap: 4px; padding: 4px; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user