opencode/packages/web/src/components/diffview.module.css

86 lines
1.6 KiB
CSS
Raw Normal View History

2025-05-31 01:58:32 +08:00
.diff {
display: grid;
2025-05-31 04:42:56 +08:00
grid-template-columns: 1fr 1fr;
2025-05-31 01:58:32 +08:00
border: 1px solid var(--sl-color-divider);
background-color: var(--sl-color-bg-surface);
border-radius: 0.25rem;
2025-05-31 04:42:56 +08:00
}
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
.column {
2025-06-01 02:41:00 +08:00
display: flex;
2025-05-31 04:42:56 +08:00
flex-direction: column;
2025-06-04 03:55:31 +08:00
overflow-x: visible;
2025-05-31 04:42:56 +08:00
min-width: 0;
2025-06-04 03:55:31 +08:00
align-items: stretch;
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
&:first-child {
border-right: 1px solid var(--sl-color-divider);
2025-05-31 01:58:32 +08:00
}
2025-05-31 04:42:56 +08:00
& > [data-section="cell"]:first-child {
padding-top: 0.5rem;
}
& > [data-section="cell"]:last-child {
padding-bottom: 0.5rem;
}
}
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
[data-section="cell"] {
position: relative;
flex: none;
2025-06-04 03:55:31 +08:00
width: 100%;
2025-06-05 00:32:23 +08:00
padding: 0.1875rem 0.5rem 0.1875rem 2.2ch;
2025-05-31 04:42:56 +08:00
margin: 0;
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
pre {
2025-06-04 03:55:31 +08:00
--shiki-dark-bg: var(--sl-color-bg-surface) !important;
2025-05-31 04:42:56 +08:00
background-color: var(--sl-color-bg-surface) !important;
2025-06-04 03:55:31 +08:00
white-space: pre-wrap;
word-break: break-word;
2025-05-31 04:42:56 +08:00
code > span:empty::before {
content: "\00a0";
white-space: pre;
display: inline-block;
width: 0;
2025-05-31 01:58:32 +08:00
}
}
2025-05-31 04:42:56 +08:00
}
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
[data-diff-type="removed"] {
background-color: var(--sl-color-red-low);
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
pre {
2025-06-04 03:55:31 +08:00
--shiki-dark-bg: var(--sl-color-red-low) !important;
2025-05-31 04:42:56 +08:00
background-color: var(--sl-color-red-low) !important;
}
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
&::before {
content: "-";
position: absolute;
left: 0.5ch;
user-select: none;
color: var(--sl-color-red-high);
2025-05-31 01:58:32 +08:00
}
2025-05-31 04:42:56 +08:00
}
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
[data-diff-type="added"] {
background-color: var(--sl-color-green-low);
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
pre {
2025-06-04 03:55:31 +08:00
--shiki-dark-bg: var(--sl-color-green-low) !important;
2025-05-31 04:42:56 +08:00
background-color: var(--sl-color-green-low) !important;
}
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
&::before {
content: "+";
position: absolute;
left: 0.6ch;
user-select: none;
color: var(--sl-color-green-high);
2025-05-31 01:58:32 +08:00
}
}