@monochrome-edge/ui
Version:
A modern, minimalist UI with Warm and Cold themes
359 lines (312 loc) • 6.94 kB
CSS
/* Command Palette Component */
.command-palette-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
z-index: 2000;
display: flex;
align-items: flex-start;
justify-content: center;
padding-top: 10vh;
opacity: 0;
animation: fadeIn 0.2s ease forwards;
}
.command-palette {
width: 640px;
max-width: 90vw;
max-height: 70vh;
background: var(--theme-surface);
border-radius: var(--border-radius-lg);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
transform: scale(0.95) translateY(-20px);
animation: slideDown 0.2s ease forwards;
}
/* Command Input */
.command-input-wrapper {
position: relative;
border-bottom: 1px solid var(--theme-border);
}
.command-input-icon {
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
color: var(--theme-text-muted);
pointer-events: none;
}
.command-input {
width: 100%;
padding: 1rem 1rem 1rem 3rem;
background: transparent;
border: none;
color: var(--theme-text-primary);
font-size: 1rem;
outline: none;
}
.command-input::placeholder {
color: var(--theme-text-muted);
}
/* Command List */
.command-list {
flex: 1;
overflow-y: auto;
padding: 0.5rem;
}
.command-list::-webkit-scrollbar {
width: 6px;
}
.command-list::-webkit-scrollbar-track {
background: transparent;
}
.command-list::-webkit-scrollbar-thumb {
background: var(--theme-border);
border-radius: 3px;
}
/* Command Group */
.command-group {
margin-bottom: 0.5rem;
}
.command-group-title {
padding: 0.5rem 0.75rem;
font-size: 0.75rem;
font-weight: 600;
color: var(--theme-text-muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
/* Command Item */
.command-item {
padding: 0.75rem 1rem;
border-radius: var(--border-radius-sm);
cursor: pointer;
display: flex;
align-items: center;
gap: 0.75rem;
transition: all 0.2s;
position: relative;
}
.command-item:hover {
background: var(--theme-bg);
}
.command-item.selected {
background: var(--theme-bg);
color: var(--theme-accent);
}
.command-item.selected::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 60%;
background: var(--theme-accent);
border-radius: 0 2px 2px 0;
}
/* Command Item Icon */
.command-item-icon {
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
color: var(--theme-text-secondary);
flex-shrink: 0;
}
.command-item.selected .command-item-icon {
color: var(--theme-accent);
}
/* Command Item Content */
.command-item-content {
flex: 1;
min-width: 0;
}
.command-item-title {
font-size: 0.95rem;
font-weight: 500;
color: var(--theme-text-primary);
margin-bottom: 0.125rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.command-item-description {
font-size: 0.8125rem;
color: var(--theme-text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Command Item Badge */
.command-item-badge {
padding: 0.125rem 0.375rem;
background: var(--theme-bg);
color: var(--theme-text-secondary);
border-radius: var(--border-radius-sm);
font-size: 0.75rem;
font-weight: 500;
}
/* Command Shortcuts */
.command-shortcuts {
display: flex;
gap: 0.25rem;
margin-left: auto;
}
.command-key {
padding: 0.125rem 0.375rem;
background: var(--theme-bg);
border: 1px solid var(--theme-border);
border-radius: var(--border-radius-sm);
font-size: 0.75rem;
font-family: monospace;
color: var(--theme-text-secondary);
min-width: 24px;
text-align: center;
}
/* Command Footer */
.command-footer {
padding: 0.75rem 1rem;
border-top: 1px solid var(--theme-border);
display: flex;
align-items: center;
justify-content: space-between;
font-size: 0.8125rem;
color: var(--theme-text-muted);
}
.command-footer-hints {
display: flex;
gap: 1rem;
}
.command-hint {
display: flex;
align-items: center;
gap: 0.375rem;
}
.command-hint-key {
padding: 0.125rem 0.375rem;
background: var(--theme-bg);
border: 1px solid var(--theme-border);
border-radius: var(--border-radius-sm);
font-size: 0.75rem;
font-family: monospace;
}
/* Empty State */
.command-empty {
padding: 3rem 2rem;
text-align: center;
}
.command-empty-icon {
width: 48px;
height: 48px;
margin: 0 auto 1rem;
color: var(--theme-text-muted);
opacity: 0.5;
}
.command-empty-title {
font-size: 1rem;
font-weight: 500;
color: var(--theme-text-primary);
margin-bottom: 0.5rem;
}
.command-empty-description {
font-size: 0.875rem;
color: var(--theme-text-muted);
}
/* Loading State */
.command-loading {
padding: 3rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.command-spinner {
width: 32px;
height: 32px;
border: 3px solid var(--theme-border);
border-top-color: var(--theme-accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin-bottom: 1rem;
}
/* Recent/Favorite Items */
.command-item.recent::after,
.command-item.favorite::after {
content: '';
width: 6px;
height: 6px;
background: var(--theme-warning);
border-radius: 50%;
position: absolute;
top: 0.75rem;
right: 0.75rem;
}
.command-item.favorite::after {
background: var(--theme-error);
}
/* Breadcrumb Navigation */
.command-breadcrumb {
padding: 0.75rem 1rem;
border-bottom: 1px solid var(--theme-border);
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.875rem;
color: var(--theme-text-muted);
}
.command-breadcrumb-item {
display: flex;
align-items: center;
gap: 0.5rem;
}
.command-breadcrumb-separator {
color: var(--theme-text-muted);
opacity: 0.5;
}
.command-breadcrumb-link {
color: var(--theme-text-secondary);
cursor: pointer;
transition: color 0.2s;
}
.command-breadcrumb-link:hover {
color: var(--theme-accent);
}
/* Animations */
@keyframes fadeIn {
to {
opacity: 1;
}
}
@keyframes slideDown {
to {
transform: scale(1) translateY(0);
}
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Responsive */
@media (max-width: 640px) {
.command-palette {
max-height: 80vh;
margin: 1rem;
}
.command-footer {
flex-direction: column;
gap: 0.5rem;
align-items: flex-start;
}
.command-footer-hints {
flex-wrap: wrap;
}
}