дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-23 10:00:48 +02:00
449 рядки
10 KiB
CSS
449 рядки
10 KiB
CSS
.root {
|
|
position: relative;
|
|
container: diff-editor / inline-size;
|
|
flex: 1;
|
|
height: 100%;
|
|
min-height: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--bg-app);
|
|
}
|
|
.toolbar[hidden] {
|
|
display: none;
|
|
}
|
|
.toolbar {
|
|
flex: none;
|
|
min-height: var(--h-header);
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
align-content: center;
|
|
gap: var(--space-0-5);
|
|
padding: var(--space-0-5) var(--space-1-5);
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
.toolbar > * {
|
|
flex-shrink: 0;
|
|
}
|
|
.sep {
|
|
width: 1px;
|
|
height: 14px;
|
|
margin: 0 4px;
|
|
background: var(--border-strong);
|
|
}
|
|
.toolbar > .statusTools {
|
|
flex-shrink: 1;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
gap: var(--space-0-5);
|
|
min-inline-size: 0;
|
|
max-inline-size: 100%;
|
|
margin-inline-start: auto;
|
|
}
|
|
.statusTools > :not(.count) {
|
|
flex: none;
|
|
}
|
|
.count {
|
|
min-inline-size: 0;
|
|
max-inline-size: 100%;
|
|
padding-inline: var(--space-1-5);
|
|
color: var(--fg-subtle);
|
|
font-size: var(--fs-small);
|
|
font-variant-numeric: tabular-nums;
|
|
overflow-wrap: anywhere;
|
|
text-align: end;
|
|
}
|
|
.count:empty {
|
|
display: none;
|
|
}
|
|
/* Narrow (a side-docked preview): the whitespace / highlighting pickers stay in the gear menu. */
|
|
@container diff-editor (max-width: 640px) {
|
|
.select {
|
|
display: none;
|
|
}
|
|
}
|
|
@container diff-editor (max-width: 520px) {
|
|
.toolbar > .sep,
|
|
.toolbar > .inlineOption {
|
|
display: none;
|
|
}
|
|
}
|
|
.labels {
|
|
flex: none;
|
|
display: flex;
|
|
height: var(--h-row);
|
|
border-bottom: 1px solid var(--border);
|
|
color: var(--fg-secondary);
|
|
font-size: var(--fs-small);
|
|
}
|
|
.label {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
padding: 0 12px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
font-family: var(--font-mono);
|
|
}
|
|
.label + .label {
|
|
border-left: 1px solid var(--border);
|
|
}
|
|
/* Side by side, the right label starts at the right pane (`--diff-b-start`, set by the viewer). */
|
|
.labels > .label:first-child:not(:only-child) {
|
|
flex: 0 0 var(--diff-b-start, 50%);
|
|
}
|
|
.labelFile {
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
color: var(--fg-subtle);
|
|
font-family: var(--font-ui);
|
|
}
|
|
.sourceLabels {
|
|
font-size: var(--fs-ui);
|
|
}
|
|
.sourceLabels .label {
|
|
font-family: var(--font-ui);
|
|
}
|
|
.sourceLabels .labelText {
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
.sourceLabels .labelFile {
|
|
font-size: var(--fs-small);
|
|
}
|
|
.badge {
|
|
padding: 0 5px;
|
|
border-radius: var(--radius-small);
|
|
background: var(--accent-soft);
|
|
color: var(--accent);
|
|
font-family: var(--font-ui);
|
|
font-size: var(--fs-tiny);
|
|
line-height: 15px;
|
|
}
|
|
/* The editor's find bar, over the side it searches (side-by-side) or the whole viewer. */
|
|
.findRow {
|
|
flex: none;
|
|
display: flex;
|
|
background: var(--bg-editor-inline, var(--bg-elev));
|
|
border-bottom: 1px solid var(--border-editor-tabs, var(--border));
|
|
}
|
|
.findRow > div {
|
|
flex: 1;
|
|
min-width: 0;
|
|
border-bottom: none;
|
|
}
|
|
.findRowSplit > div {
|
|
flex: 0 0 var(--diff-b-start, 50%);
|
|
border-right: 1px solid var(--border);
|
|
}
|
|
.findRowRight {
|
|
justify-content: flex-end;
|
|
}
|
|
.findRowRight > div {
|
|
flex-basis: calc(100% - var(--diff-b-start, 50%));
|
|
border-right: none;
|
|
border-left: 1px solid var(--border);
|
|
}
|
|
.message {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 24px;
|
|
color: var(--fg-subtle);
|
|
}
|
|
.host {
|
|
flex: 1;
|
|
min-height: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
}
|
|
.host:not([hidden]) {
|
|
animation: diff-enter var(--dur) var(--ease) both;
|
|
}
|
|
.host[hidden] {
|
|
display: none;
|
|
}
|
|
.host > :global(.cm-editor) {
|
|
flex: 1;
|
|
min-height: 0;
|
|
}
|
|
.host :global(.cm-mergeView) {
|
|
flex: 1;
|
|
min-height: 0;
|
|
/* The panes scroll themselves (`.paneScroll`); a fitted block is content-tall and its host scrolls. */
|
|
overflow: hidden;
|
|
}
|
|
.host :global(.cm-mergeViewEditors) {
|
|
min-height: 100%;
|
|
}
|
|
.host :global(.cm-mergeViewEditor) {
|
|
min-width: 0;
|
|
/* Clips like the library's `hidden` without becoming a scroll container. */
|
|
overflow: clip;
|
|
}
|
|
.host :global(.cm-merge-revert) {
|
|
width: 22px;
|
|
background: var(--bg-elev);
|
|
border-left: 1px solid var(--border);
|
|
border-right: 1px solid var(--border);
|
|
}
|
|
.host :global(.cm-merge-revert button) {
|
|
width: 20px;
|
|
margin-left: 1px;
|
|
color: var(--fg-subtle);
|
|
font-size: var(--fs-small);
|
|
border-radius: var(--radius-small);
|
|
}
|
|
.host :global(.cm-merge-revert button:hover) {
|
|
color: var(--fg-strong);
|
|
background: transparent;
|
|
}
|
|
.select {
|
|
height: var(--h-control-small);
|
|
font-size: var(--fs-small);
|
|
}
|
|
.host :global(.cm-diffArrows) {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1px;
|
|
}
|
|
.host :global(.cm-merge-revert button.cm-diffArrow) {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 16px;
|
|
padding: 0;
|
|
border: 0;
|
|
background: none;
|
|
cursor: pointer;
|
|
}
|
|
.host :global(.cm-diffHoverLine) {
|
|
position: relative;
|
|
}
|
|
.host :global(.cm-diffHoverRevert) {
|
|
position: absolute;
|
|
right: 8px;
|
|
/* Centre on the first row, including when the editor's line height changes. */
|
|
top: calc((var(--openidea-editor-line-height, var(--lh-code)) - var(--space-4)) / 2);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 3px;
|
|
height: var(--space-4);
|
|
padding: 0 6px;
|
|
border: 1px solid var(--border-strong);
|
|
border-radius: var(--radius-small);
|
|
background: var(--bg-elev);
|
|
color: var(--fg-secondary);
|
|
font-family: var(--font-ui);
|
|
font-size: var(--fs-tiny);
|
|
cursor: pointer;
|
|
}
|
|
.host :global(.cm-diffHoverRevert:hover) {
|
|
color: var(--fg-strong);
|
|
background: var(--bg-hover);
|
|
}
|
|
.noHighlight :global(.cm-changedLine),
|
|
.noHighlight :global(.cm-insertedLine),
|
|
.noHighlight :global(.cm-changedText),
|
|
.noHighlight :global(.cm-diffLine),
|
|
.noHighlight :global(.cm-diffChangedGutter) {
|
|
background: none !important;
|
|
}
|
|
/* Every split diff but a fitted block: each pane scrolls itself (both axes), so its
|
|
horizontal scrollbar stays at the pane's bottom edge — a content-tall scroller would
|
|
render it at the content's end, out of reach until the diff is scrolled there. */
|
|
.paneScroll :global(.cm-mergeViewEditors) {
|
|
height: 100%;
|
|
min-height: 0;
|
|
}
|
|
.paneScroll :global(.cm-mergeViewEditor) {
|
|
height: 100%;
|
|
min-height: 0;
|
|
}
|
|
/* Overrides MergeView's base theme, which leaves scrolling to the outer view. */
|
|
.paneScroll :global(.cm-mergeViewEditor > .cm-editor),
|
|
.paneScroll :global(.cm-mergeViewEditor > .cm-editor > .cm-scroller) {
|
|
height: 100% !important;
|
|
}
|
|
.paneScroll :global(.cm-mergeViewEditor > .cm-editor > .cm-scroller) {
|
|
overflow: auto !important;
|
|
}
|
|
.host :global(.cm-diffDivider) {
|
|
position: relative;
|
|
flex: none;
|
|
width: 30px;
|
|
overflow: hidden;
|
|
background: var(--bg-app);
|
|
border-left: 1px solid var(--border);
|
|
border-right: 1px solid var(--border);
|
|
cursor: col-resize;
|
|
touch-action: none;
|
|
}
|
|
.host :global(.cm-diffDivider:hover) {
|
|
background: var(--bg-hover);
|
|
}
|
|
.host :global(.cm-diffDivider:focus-visible) {
|
|
outline: 1px solid var(--accent);
|
|
outline-offset: -1px;
|
|
}
|
|
/* Only the band layer: the chevrons inside the arrow buttons are centred by the button's flex box. */
|
|
.host :global(.cm-diffDivider > svg) {
|
|
position: absolute;
|
|
inset: 0;
|
|
}
|
|
/* The full colours of the change types (cm.ts), so bands and their midlines read as one shape. */
|
|
.host :global(.cm-diffBand-inserted) {
|
|
--band: var(--diff-inserted);
|
|
}
|
|
.host :global(.cm-diffBand-deleted) {
|
|
--band: var(--diff-deleted);
|
|
}
|
|
.host :global(.cm-diffBand-modified) {
|
|
--band: var(--diff-modified);
|
|
}
|
|
.host :global(.cm-diffBand) {
|
|
fill: var(--band);
|
|
}
|
|
.host :global(.cm-diffBandLine) {
|
|
fill: none;
|
|
stroke: var(--band);
|
|
stroke-width: 1px;
|
|
}
|
|
.host :global(.cm-diffDivider button.cm-diffArrow) {
|
|
position: absolute;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 14px;
|
|
height: 16px;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: var(--radius-small);
|
|
background: none;
|
|
color: var(--fg-subtle);
|
|
cursor: pointer;
|
|
}
|
|
.host :global(.cm-diffDivider button.cm-diffArrow-a-to-b) {
|
|
left: 0;
|
|
}
|
|
.host :global(.cm-diffDivider button.cm-diffArrow-b-to-a) {
|
|
right: 0;
|
|
}
|
|
/* With one direction there is no pair to keep apart: the arrow sits in the middle of the divider. */
|
|
.host :global(.cm-diffDivider-lone button.cm-diffArrow) {
|
|
left: 50%;
|
|
right: auto;
|
|
transform: translateX(-50%);
|
|
}
|
|
.host :global(.cm-diffDivider button.cm-diffArrow:hover) {
|
|
color: var(--fg-strong);
|
|
background: transparent;
|
|
}
|
|
/* Where the other pane has lines this one lacks. */
|
|
.host :global(.cm-diffGap-inserted) {
|
|
box-shadow: inset 0 1px 0 var(--gutter-added);
|
|
}
|
|
.host :global(.cm-diffGap-deleted) {
|
|
box-shadow: inset 0 1px 0 var(--gutter-deleted);
|
|
}
|
|
.host :global(.cm-diffGap-inserted.cm-diffGapEnd) {
|
|
box-shadow: inset 0 -1px 0 var(--gutter-added);
|
|
}
|
|
.host :global(.cm-diffGap-deleted.cm-diffGapEnd) {
|
|
box-shadow: inset 0 -1px 0 var(--gutter-deleted);
|
|
}
|
|
|
|
/* Review comments under diff lines (pull requests). */
|
|
.notes {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-1-5);
|
|
margin: 4px 8px 6px 8px;
|
|
padding: 6px 10px;
|
|
border: 1px solid var(--border-strong);
|
|
border-radius: var(--radius-control);
|
|
background: var(--bg-elev);
|
|
font-family: var(--font-ui);
|
|
font-size: var(--fs-ui);
|
|
color: var(--fg);
|
|
white-space: normal;
|
|
}
|
|
.note + .note {
|
|
padding-top: 6px;
|
|
border-top: 1px solid var(--border);
|
|
}
|
|
.noteHead {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
font-size: var(--fs-small);
|
|
color: var(--fg-subtle);
|
|
}
|
|
.noteAuthor {
|
|
color: var(--fg-strong);
|
|
font-weight: 600;
|
|
}
|
|
.noteBody {
|
|
margin-top: 2px;
|
|
white-space: pre-wrap;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
|
|
.navHint {
|
|
position: absolute;
|
|
left: 50%;
|
|
bottom: 40px;
|
|
transform: translateX(-50%);
|
|
z-index: 5;
|
|
padding: 6px 12px;
|
|
border: 1px solid var(--border-tooltip);
|
|
border-radius: var(--radius-tooltip);
|
|
background: var(--bg-tooltip);
|
|
color: var(--fg-tooltip);
|
|
box-shadow: var(--shadow-tooltip);
|
|
font-size: var(--fs-small);
|
|
pointer-events: none;
|
|
}
|
|
|
|
@keyframes diff-enter {
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.host:not([hidden]) {
|
|
animation: none;
|
|
}
|
|
}
|
|
|
|
/* A block of the all-in-one diff: as tall as its content, the tab scrolls. */
|
|
.fit {
|
|
flex: none;
|
|
height: auto;
|
|
}
|
|
.fit .host {
|
|
flex: none;
|
|
}
|
|
.fit .host > :global(.cm-editor) {
|
|
flex: none;
|
|
}
|
|
.fit .host :global(.cm-mergeView) {
|
|
flex: none;
|
|
overflow-y: visible;
|
|
}
|
|
.fit .host :global(.cm-mergeViewEditors) {
|
|
min-height: 0;
|
|
}
|