fix: harden kumo base component styling

This commit is contained in:
2026-07-02 10:21:25 -07:00
parent 04f2dfc229
commit c394d85236
9 changed files with 234 additions and 13 deletions

View File

@@ -1,6 +1,8 @@
@import "tailwindcss";
@import "@cloudflare/kumo/styles";
@source "../node_modules/@cloudflare/kumo/dist";
@custom-variant dark (&:is(.dark *));
@theme inline {
@@ -138,6 +140,207 @@ a,
z-index: 40;
}
.teatea-button {
min-height: 2.5rem;
border-radius: var(--radius-md);
font-weight: 600;
transition:
background-color 140ms ease,
border-color 140ms ease,
color 140ms ease,
box-shadow 140ms ease,
opacity 140ms ease;
}
.teatea-button:focus-visible,
.teatea-control:focus-visible,
:where([data-kumo-component="Select"][data-kumo-part="trigger"]):focus-visible {
outline: none;
box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 24%, transparent);
}
.teatea-button-default {
border: 1px solid var(--primary);
background: var(--primary);
color: var(--primary-foreground);
}
.teatea-button-default:hover {
background: color-mix(in oklch, var(--primary) 88%, black);
border-color: color-mix(in oklch, var(--primary) 88%, black);
}
.teatea-button-outline,
.teatea-button-secondary {
border: 1px solid var(--border);
background: var(--card);
color: var(--foreground);
}
.teatea-button-outline:hover,
.teatea-button-secondary:hover,
.teatea-button-ghost:hover {
border-color: color-mix(in oklch, var(--primary) 45%, var(--border));
background: color-mix(in oklch, var(--secondary) 72%, white);
color: var(--accent-foreground);
}
.teatea-button-ghost {
border: 1px solid transparent;
background: transparent;
color: var(--foreground);
}
.teatea-button-destructive {
border: 1px solid var(--destructive);
background: var(--destructive);
color: var(--destructive-foreground);
}
.teatea-control,
:where([data-kumo-component="Select"][data-kumo-part="trigger"]) {
min-height: 2.5rem;
width: 100%;
border: 1px solid var(--input);
border-radius: var(--radius-md);
background: var(--card);
color: var(--foreground);
font-size: 0.875rem;
font-weight: 500;
box-shadow: 0 1px 2px color-mix(in oklch, var(--foreground) 7%, transparent);
transition:
background-color 140ms ease,
border-color 140ms ease,
box-shadow 140ms ease;
}
.teatea-control {
padding: 0.5rem 0.75rem;
}
:where([data-kumo-component="Select"][data-kumo-part="trigger"]) {
appearance: none;
outline: none;
padding: 0.5rem 0.75rem;
text-align: left;
}
.teatea-control:hover,
:where([data-kumo-component="Select"][data-kumo-part="trigger"]):hover {
border-color: color-mix(in oklch, var(--primary) 45%, var(--input));
background: color-mix(in oklch, var(--secondary) 34%, white);
}
.teatea-control::placeholder {
color: var(--muted-foreground);
}
.teatea-control:disabled,
.teatea-button:disabled,
:where([data-kumo-component="Select"][data-kumo-part="trigger"][data-disabled]) {
cursor: not-allowed;
opacity: 0.55;
}
.teatea-select :where(svg),
:where([data-kumo-component="Select"][data-kumo-part="trigger"]) :where(svg) {
color: var(--primary);
}
:where([role="listbox"]:has([data-kumo-component="Select"][data-kumo-part="option"])) {
z-index: 60;
outline: none;
max-height: min(18rem, var(--available-height, 18rem));
min-width: var(--anchor-width, 12rem);
overflow-y: auto;
overscroll-behavior: contain;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--card);
color: var(--foreground);
padding: 0.375rem;
box-shadow:
0 18px 44px color-mix(in oklch, var(--foreground) 14%, transparent),
0 0 0 1px color-mix(in oklch, var(--primary) 10%, transparent);
}
:where([data-kumo-component="Select"][data-kumo-part="option"]) {
min-height: 2.25rem;
cursor: pointer;
outline: none;
border-radius: calc(var(--radius-md) - 2px);
padding: 0.5rem 0.625rem;
color: var(--foreground);
font-size: 0.875rem;
}
:where([data-kumo-component="Select"][data-kumo-part="option"][data-highlighted]),
:where([data-kumo-component="Select"][data-kumo-part="option"]):hover {
background: var(--secondary);
color: var(--secondary-foreground);
}
:where([data-kumo-component="Select"][data-kumo-part="option"][data-selected]) {
color: var(--primary);
font-weight: 600;
}
.teatea-checkbox :where([data-kumo-component="Checkbox"]) {
border: 1px solid var(--input);
border-radius: var(--radius-sm);
background: var(--card);
color: var(--primary-foreground);
}
.teatea-badge {
border-radius: var(--radius-sm);
font-weight: 600;
}
.teatea-card {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--card);
color: var(--card-foreground);
box-shadow:
0 1px 2px color-mix(in oklch, var(--foreground) 6%, transparent),
0 0 0 1px color-mix(in oklch, var(--primary) 4%, transparent);
}
.teatea-card-header {
background: color-mix(in oklch, var(--secondary) 18%, var(--card));
}
.teatea-table {
width: 100%;
border-collapse: collapse;
color: var(--foreground);
}
.teatea-table :where(thead) {
border-bottom: 1px solid var(--border);
background: var(--secondary);
}
.teatea-table :where(th) {
color: var(--muted-foreground);
font-weight: 600;
}
.teatea-table :where(tbody tr:hover) {
background: color-mix(in oklch, var(--secondary) 42%, transparent);
}
.teatea-dialog {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--card);
color: var(--foreground);
box-shadow:
0 26px 80px color-mix(in oklch, var(--foreground) 16%, transparent),
0 0 0 1px color-mix(in oklch, var(--primary) 10%, transparent);
}
.loading-progress {
width: 55%;
animation: loading-progress 900ms ease-in-out infinite;