Files
Frost/controls.css
T

74 lines
5.9 KiB
CSS

@layer frost.controls {
:where(.frost-button) {
display: inline-flex;
min-height: 2.5rem;
align-items: center;
justify-content: center;
gap: var(--frost-space-2);
padding: var(--frost-space-2) var(--frost-space-4);
border: 1px solid transparent;
border-radius: var(--frost-radius-md);
background: transparent;
color: inherit;
font-weight: 650;
line-height: 1.2;
text-decoration: none;
transition: background-color var(--frost-duration-base) var(--frost-ease-standard), border-color var(--frost-duration-base) var(--frost-ease-standard), color var(--frost-duration-base) var(--frost-ease-standard), transform var(--frost-duration-fast) var(--frost-ease-out);
}
:where(.frost-button--primary) { border-color: var(--frost-color-accent); background: var(--frost-color-accent); color: var(--frost-color-on-accent); }
:where(.frost-button--secondary) { border-color: var(--frost-color-border-strong); background: var(--frost-color-surface); color: var(--frost-color-text); }
:where(.frost-button--ghost) { border-color: transparent; color: var(--frost-color-accent); }
:where(.frost-button--danger) { border-color: var(--frost-color-danger); background: var(--frost-color-danger); color: var(--frost-color-on-danger); }
:where(.frost-button--success) { border-color: var(--frost-color-success); background: var(--frost-color-success); color: var(--frost-color-on-success); }
:where(.frost-button--link) { min-height: auto; padding: 0; border-color: transparent; color: var(--frost-color-accent); text-decoration: underline; text-underline-offset: 0.15em; }
:where(.frost-button--block) { width: 100%; }
:where(.frost-button--lg) { min-height: 3rem; padding: var(--frost-space-3) var(--frost-space-5); font-size: var(--frost-font-size-lg); }
:where(.frost-button--primary:hover:not(:disabled):not([aria-disabled="true"])) { background: var(--frost-color-accent-hover); border-color: var(--frost-color-accent-hover); }
:where(.frost-button--secondary:hover:not(:disabled):not([aria-disabled="true"])) { background: var(--frost-color-surface-hover); }
:where(.frost-button--ghost:hover:not(:disabled):not([aria-disabled="true"])) { background: var(--frost-color-surface-soft); }
:where(.frost-button--danger:hover:not(:disabled):not([aria-disabled="true"])) { filter: brightness(0.92); }
:where(.frost-button--success:hover:not(:disabled):not([aria-disabled="true"])) { filter: brightness(0.92); }
:where(.frost-button--link:hover:not(:disabled):not([aria-disabled="true"])) { background: var(--frost-color-surface-soft); }
:where(.frost-button:active:not(:disabled):not([aria-disabled="true"])) { transform: translateY(1px); }
:where(.frost-button:disabled, .frost-button[aria-disabled="true"]) { opacity: 0.55; cursor: not-allowed; }
:where(.frost-button--sm) { min-height: 2rem; padding: var(--frost-space-1) var(--frost-space-2); font-size: var(--frost-font-size-sm); }
:where(.frost-button--icon) { width: 2.5rem; min-width: 2.5rem; padding: var(--frost-space-2); }
:where(.frost-input, .frost-select, .frost-textarea) {
display: block;
width: 100%;
min-height: 2.5rem;
padding: var(--frost-space-2) var(--frost-space-3);
border: 1px solid var(--frost-color-border-strong);
border-radius: var(--frost-radius-md);
background: var(--frost-color-surface);
color: var(--frost-color-text);
line-height: 1.4;
transition: border-color var(--frost-duration-base) var(--frost-ease-standard), background-color var(--frost-duration-base) var(--frost-ease-standard), box-shadow var(--frost-duration-base) var(--frost-ease-standard);
}
:where(.frost-textarea) { min-height: 7rem; resize: vertical; }
:where(.frost-input::placeholder, .frost-textarea::placeholder) { color: var(--frost-color-text-muted); opacity: 1; }
:where(.frost-input:focus, .frost-select:focus, .frost-textarea:focus) { border-color: var(--frost-focus-color); box-shadow: 0 0 0 var(--frost-focus-width) rgb(37 99 235 / 0.22); box-shadow: 0 0 0 var(--frost-focus-width) color-mix(in srgb, var(--frost-focus-color) 22%, transparent); }
:where(.frost-input:disabled, .frost-select:disabled, .frost-textarea:disabled) { background: var(--frost-color-surface-soft); opacity: 0.65; }
:where(.frost-input[aria-invalid="true"], .frost-select[aria-invalid="true"], .frost-textarea[aria-invalid="true"]) { border-color: var(--frost-color-danger); }
:where(.frost-input[aria-invalid="true"]:focus, .frost-select[aria-invalid="true"]:focus, .frost-textarea[aria-invalid="true"]:focus) { box-shadow: 0 0 0 var(--frost-focus-width) color-mix(in srgb, var(--frost-color-danger) 22%, transparent); }
:where(.frost-input[aria-busy="true"], .frost-select[aria-busy="true"], .frost-textarea[aria-busy="true"]) { background-image: linear-gradient(90deg, transparent, var(--frost-color-surface-soft), transparent); background-size: 200% 100%; animation: frost-control-loading 1.2s linear infinite; }
:where(.frost-input--success, .frost-select--success, .frost-textarea--success, .frost-input[aria-invalid="false"], .frost-select[aria-invalid="false"], .frost-textarea[aria-invalid="false"]) { border-color: var(--frost-color-success); }
:where(.frost-input--warning, .frost-select--warning, .frost-textarea--warning) { border-color: var(--frost-color-warning); }
:where(.frost-input--readonly, .frost-input[readonly]) { background: var(--frost-color-surface-soft); }
:where(.frost-field--disabled) { opacity: 0.65; }
.frost-field { display: grid; gap: var(--frost-space-2); }
.frost-label { color: var(--frost-color-text); font-weight: 650; }
.frost-help, .frost-error { font-size: var(--frost-font-size-sm); }
.frost-help { color: var(--frost-color-text-muted); }
.frost-error { color: var(--frost-color-danger); }
.frost-success { color: var(--frost-color-success); }
.frost-warning { color: var(--frost-color-warning); }
@keyframes frost-control-loading { to { background-position: -200% 0; } }
}