源码
packages/desktop/src/renderer/command-settings.css
/* ZCode CommandsSection, CommandCard and CommandForm; local design tokens. */
.command-settings {
display: flex;
flex-direction: column;
gap: 16px;
}
.command-settings-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 8px;
}
.command-scope-count {
min-width: 0;
display: flex;
align-items: center;
gap: 12px;
white-space: nowrap;
}
.command-scope-count > i {
width: 1px;
height: 16px;
background: var(--color-border);
}
.command-scope-count strong {
font-size: var(--text-body);
font-weight: 500;
}
.command-settings small {
font-size: var(--text-small);
font-weight: 400;
color: var(--color-text-subtle);
}
.command-summary > small {
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 18px;
}
.command-scope-count strong small,
.command-installed-header h3 small {
margin-left: 5px;
}
.settings-screen .command-scope {
max-width: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
height: 28px;
padding: 0 9px;
border: 1px solid var(--color-border);
border-radius: 999px;
font-size: var(--text-body);
background: transparent;
white-space: nowrap;
}
.command-scope > svg:last-child {
color: var(--color-text-subtle);
}
.command-search {
display: flex;
align-items: center;
gap: 8px;
width: 256px;
height: 36px;
padding: 0 12px;
border: 1px solid var(--color-border);
border-radius: 12px;
background: var(--color-input);
color: var(--color-text-subtle);
}
.settings-screen .command-search input {
min-width: 0;
width: 100%;
height: 100%;
padding: 0;
border: none;
outline: none;
background: transparent;
font-size: var(--text-body);
}
.command-installed-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.command-settings h3 {
margin: 0;
font-size: var(--text-body);
line-height: 28px;
font-weight: 500;
}
.command-settings > h3 {
font-size: var(--text-title);
font-weight: 600;
}
.command-header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.command-new {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
min-height: 28px;
padding: 0 8px;
border-radius: 8px;
background: var(--color-primary);
color: var(--color-on-primary);
font-size: var(--text-body);
font-weight: 500;
}
.command-new:disabled {
opacity: 0.45;
}
.command-list {
overflow: hidden;
border-radius: 12px;
background: var(--color-surface);
}
.command-row {
display: flex;
align-items: center;
gap: 12px;
padding-right: 16px;
}
.command-row + .command-row {
border-top: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
}
.command-row:hover {
background: var(--color-fill-hover);
}
.settings-screen .command-edit {
flex: 1;
display: flex;
align-items: center;
gap: 12px;
min-width: 0;
padding: 12px 0 12px 16px;
text-align: left;
border-radius: 0;
background: transparent;
}
.command-avatar {
display: flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: 12px;
background: var(--color-bg);
color: var(--color-text-subtle);
}
.command-summary {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
gap: 2px;
}
.command-name {
overflow-wrap: anywhere;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
font-size: var(--text-body);
font-weight: 500;
line-height: 20px;
}
.command-name > span {
color: var(--color-text-muted);
font-weight: 400;
}
.command-empty {
border: 1px dashed var(--color-border);
border-radius: 12px;
padding: 40px 16px;
text-align: center;
color: var(--color-text-subtle);
}
.command-empty .command-new {
min-height: 32px;
padding: 0 10px;
}
.command-empty h3 {
color: var(--color-text);
}
.command-empty p {
font-size: var(--text-small);
margin: 8px 0 16px;
}
.command-form {
display: flex;
flex-direction: column;
gap: 12px;
padding: 16px;
border: 1px solid var(--color-border);
border-radius: 12px;
}
.command-form label {
display: flex;
flex-direction: column;
gap: 6px;
font-size: var(--text-body);
font-weight: 500;
color: var(--color-text-subtle);
}
.settings-screen .command-form input,
.settings-screen .command-form textarea {
width: 100%;
padding: 8px 12px;
border: 1px solid var(--color-border);
border-radius: 8px;
color: var(--color-text);
background: var(--color-input);
font-size: var(--text-body);
font-weight: 400;
}
.settings-screen .command-form input {
height: 32px;
padding: 6px 12px;
}
.settings-screen .command-form textarea {
min-height: 112px;
resize: vertical;
}
.settings-screen .command-form :is(input, textarea):focus {
border-color: var(--color-border-strong);
}
.command-form-top {
display: flex;
align-items: start;
justify-content: space-between;
gap: 12px;
}
.command-form-top > label {
width: 192px;
}
.command-form-top > span {
min-width: 0;
max-width: 100%;
flex-wrap: wrap;
justify-content: flex-end;
display: flex;
align-items: center;
gap: 8px;
font-size: var(--text-body);
color: var(--color-text-subtle);
}
.command-form-actions {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 8px;
margin-top: 4px;
}
.command-form-actions > button {
min-height: 32px;
padding: 0 10px;
border-radius: 8px;
font-size: var(--text-body);
}
.settings-screen .command-delete {
display: inline-flex;
align-items: center;
gap: 6px;
margin-right: auto;
padding-left: 0;
color: var(--color-danger);
}
.modal-backdrop.command-confirm-backdrop {
z-index: 149;
}
.command-delete-dialog {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: min(420px, calc(100vw - 32px));
padding: 24px;
z-index: 150;
border: 1px solid var(--color-border);
border-radius: 16px;
background: var(--color-bg);
box-shadow: var(--shadow-menu);
}
.command-delete-dialog h2 {
margin: 0 0 12px;
font-size: 18px;
}
.command-delete-dialog p {
color: var(--color-text-subtle);
overflow-wrap: anywhere;
}
@media (max-width: 760px) {
.command-settings-toolbar {
align-items: stretch;
flex-wrap: wrap;
}
.command-search {
width: 100%;
}
.command-form-top {
flex-wrap: wrap;
}
}
/* Dropdowns render in a portal: reuse the application menu primitives, not Select's shell. */
.selection-menu.command-menu {
/* Settings is a z-index:40 surface; its body portals must sit above it. */
z-index: 60;
min-width: 128px;
font-size: var(--text-body);
}
.command-menu .menu-item {
justify-content: flex-start;
}
.selection-menu.command-scope-menu {
width: 256px;
max-width: calc(100vw - 32px);
}
.command-scope-menu .menu-item > span:first-of-type {
min-width: 0;
flex: 1;
white-space: nowrap;
}
.command-menu-separator {
height: 1px;
margin: 4px -4px;
background: var(--color-border);
}
.command-scope > span {
max-width: 192px;
overflow: hidden;
text-overflow: ellipsis;
}
/* State styles belong to the component; a generic button hover must not erase a filled action. */
.command-new:hover:not(:disabled) {
background: color-mix(in srgb, var(--color-primary) 80%, transparent);
}
.command-new:active:not(:disabled) {
background: color-mix(in srgb, var(--color-primary) 90%, transparent);
}
.command-edit:hover:not(:disabled) {
background: transparent;
}
.command-loading {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
border: 1px dashed var(--color-border);
border-radius: 12px;
padding: 40px 16px;
color: var(--color-text-subtle);
}
.command-loading-spinner {
animation: command-loading-spin 1s linear infinite;
}
@keyframes command-loading-spin {
to {
transform: rotate(360deg);
}
}
.command-confirm-delete {
background: var(--color-danger);
color: white;
}
.command-confirm-delete:hover:not(:disabled) {
background: color-mix(in srgb, var(--color-danger) 80%, transparent);
}
@media (prefers-reduced-motion: reduce) {
.command-loading-spinner {
animation: none;
}
}
@media (max-width: 760px) {
.command-form-top > label {
width: 100%;
}
.command-scope-count {
max-width: 100%;
}
.command-scope-count .command-scope {
min-width: 0;
}
}