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

81 lines
1.5 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;
overflow-x: auto;
min-width: 0;
align-items: flex-start;
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;
width: max-content;
2025-05-31 05:00:14 +08:00
padding: 0.1875rem 0.5rem 0.1875rem 1.8ch;
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 {
background-color: var(--sl-color-bg-surface) !important;
white-space: pre;
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 05:00:14 +08:00
min-width: 100%;
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
pre {
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 05:00:14 +08:00
min-width: 100%;
2025-05-31 01:58:32 +08:00
2025-05-31 04:42:56 +08:00
pre {
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
}
}