mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 10:16:37 +00:00
feat(ui): restyle Card and improve tool error cards (#16888)
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
This commit is contained in:
@@ -1,29 +1,94 @@
|
||||
[data-component="card"] {
|
||||
--card-pad-y: 10px;
|
||||
--card-pad-r: 12px;
|
||||
--card-pad-l: 10px;
|
||||
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: var(--surface-inset-base);
|
||||
border: 1px solid var(--border-weaker-base);
|
||||
transition: background-color 0.15s ease;
|
||||
position: relative;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 6px 12px;
|
||||
overflow: clip;
|
||||
padding: var(--card-pad-y) var(--card-pad-r) var(--card-pad-y) var(--card-pad-l);
|
||||
|
||||
&[data-variant="error"] {
|
||||
background-color: var(--surface-critical-weak);
|
||||
border: 1px solid var(--border-critical-base);
|
||||
color: rgba(218, 51, 25, 0.6);
|
||||
/* text-14-regular */
|
||||
font-family: var(--font-family-sans);
|
||||
font-size: var(--font-size-base);
|
||||
font-style: normal;
|
||||
font-weight: var(--font-weight-regular);
|
||||
line-height: var(--line-height-large);
|
||||
letter-spacing: var(--letter-spacing-normal);
|
||||
color: var(--text-strong);
|
||||
|
||||
/* text-12-regular */
|
||||
font-family: var(--font-family-sans);
|
||||
font-size: var(--font-size-small);
|
||||
font-style: normal;
|
||||
font-weight: var(--font-weight-regular);
|
||||
line-height: var(--line-height-large); /* 166.667% */
|
||||
letter-spacing: var(--letter-spacing-normal);
|
||||
--card-gap: 8px;
|
||||
--card-icon: 16px;
|
||||
--card-indent: 0px;
|
||||
--card-line-pad: 8px;
|
||||
|
||||
&[data-component="icon"] {
|
||||
color: var(--icon-critical-active);
|
||||
}
|
||||
--card-accent: var(--icon-active);
|
||||
|
||||
&:has([data-slot="card-title"]) {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
&:has([data-slot="card-title-icon"]) {
|
||||
--card-indent: calc(var(--card-icon) + var(--card-gap));
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: var(--card-line-pad);
|
||||
bottom: var(--card-line-pad);
|
||||
width: 2px;
|
||||
border-radius: 2px;
|
||||
background-color: var(--card-accent);
|
||||
}
|
||||
|
||||
:where([data-card="title"], [data-slot="card-title"]) {
|
||||
color: var(--text-strong);
|
||||
font-weight: var(--font-weight-medium);
|
||||
}
|
||||
|
||||
:where([data-slot="card-title"]) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--card-gap);
|
||||
}
|
||||
|
||||
:where([data-slot="card-title"]) [data-component="icon"] {
|
||||
color: var(--card-accent);
|
||||
}
|
||||
|
||||
:where([data-slot="card-title-icon"]) {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: var(--card-icon);
|
||||
height: var(--card-icon);
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
:where([data-slot="card-title-icon"][data-placeholder]) [data-component="icon"] {
|
||||
color: var(--text-weak);
|
||||
}
|
||||
|
||||
:where([data-slot="card-title-icon"])
|
||||
[data-slot="icon-svg"]
|
||||
:is(path, line, polyline, polygon, rect, circle, ellipse)[stroke] {
|
||||
stroke-width: 1.5px !important;
|
||||
}
|
||||
|
||||
:where([data-card="description"], [data-slot="card-description"]) {
|
||||
color: var(--text-base);
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
:where([data-card="actions"], [data-slot="card-actions"]) {
|
||||
padding-left: var(--card-indent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user