Files
openidea/src/styles/global.css
T
huanglininnandmoyining f86c5e3460 fix(vcs): keep a diff pane's horizontal scrollbar at its bottom edge (#3933)
In the aligned side-by-side diff the panes scroll together in the outer
MergeView, so each pane's scroller is as tall as its content and its
horizontal scrollbar renders at the bottom of the content: with wrapping
off and lines wider than the pane, the bar floats mid-screen for short
diffs and sits below the viewport for long ones, reachable only after
scrolling the diff to its end.

Every split diff but a fitted block now scrolls its panes themselves (as
the unaligned mode already does), so both scrollbars stay at the pane's
edges. The padded panes lay their lines out identically, so a small sync
copies one pane's scrollTop to the other; the overview lane is per pane
as in the unaligned mode, and the outer-scroller lane support goes away.
A fitted block keeps one stripe, on the right pane (IDEA's shared
scrollbar), not one per pane.

How it was verified:
- new e2e/diffScrollbar.spec.ts asserts in all three modes (unaligned,
  aligned, unified) that the right pane's scroller spans the host
  viewport while its content is ~24k px wider than it;
- e2e diff suite (27 cases: small diffs, a 44,000-character line, 10,000-
  line files padded / sync / unified / collapsed, soft-wrap toggles) and
  the overview-lane and diff-navigation specs pass;
- unit tests: new PaddedPanes sync cases (follow, sync off, animated
  scroll source) and the updated per-pane lane assertions pass; the full
  suite shows only the two pre-existing Windows-checkout failures
  (scripts/check-webkit path separators, generated theme docs);
- pnpm typecheck, lint, knip and build pass; touched files are oxfmt-clean.

Co-authored-by: moyining <724405566@qq.com>
2026-11-17 16:34:33 +08:00

283 lines
6.9 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@import "@fontsource-variable/inter";
@import "@fontsource-variable/jetbrains-mono";
@import "./tokens.css";
/* Monochrome icons default to the theme icon grey; callers override for selected / disabled.
Programming ligatures follow `editor.ligatures` (`data-ligatures`), inherited by every mono
preview (Find results, Usages, …). */
:root {
--icon-color: var(--fg-icon);
font-variant-ligatures: none;
}
:root[data-ligatures] {
font-variant-ligatures: normal;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body,
#root {
height: 100%;
margin: 0;
}
/* The page never scrolls: `clip` on the body leaves the viewport nothing to scroll into view. */
html {
overflow: hidden;
}
body {
background: var(--bg-frame);
color: var(--fg);
font-family: var(--font-ui);
font-size: var(--fs-ui);
line-height: 1.4;
-webkit-font-smoothing: antialiased;
overflow: clip;
-webkit-user-select: none;
user-select: none;
cursor: default;
}
/* A resize drag owns the cursor until release, even over the editor or a button. */
html[data-drag-cursor],
html[data-drag-cursor] *,
html[data-drag-cursor] *::before,
html[data-drag-cursor] *::after {
cursor: var(--drag-cursor) !important;
}
html[data-selection-lock] *:not([data-selection-scope], [data-selection-scope] *) {
-webkit-user-select: none !important;
user-select: none !important;
}
/* WebKit keeps editable text selectable whatever its user-select, so a drag passing over a
text field would extend into it; take fields outside the scope out of hit testing instead. */
html[data-selection-lock]
:is(input, textarea, [contenteditable]):not([data-selection-scope], [data-selection-scope] *) {
pointer-events: none !important;
}
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]),
textarea,
[contenteditable="true"] {
-webkit-user-select: text;
user-select: text;
cursor: text;
}
button {
font: inherit;
color: inherit;
background: none;
border: 0;
padding: 0;
/* Desktop convention: controls keep the arrow; only links get the hand. */
cursor: default;
}
input,
textarea,
select {
font: inherit;
color: inherit;
}
/* Radio buttons drawn like the Checkbox primitive (IntelliJ Islands). */
input[type="radio"] {
appearance: none;
flex: none;
width: 16px;
height: 16px;
margin: 0;
border-radius: 50%;
background: var(--bg-checkbox, var(--bg-button));
box-shadow: inset 0 0 0 1px var(--border-checkbox, var(--control-off));
cursor: default;
transition:
background var(--dur-fast) var(--ease),
box-shadow var(--dur-fast) var(--ease);
}
input[type="radio"]:checked {
background: radial-gradient(circle, var(--fg-button-primary) 0 2.5px, transparent 3px), var(--bg-button-primary);
box-shadow: none;
}
input[type="radio"]:disabled {
background: transparent;
box-shadow: inset 0 0 0 1px var(--border);
}
input[type="radio"]:disabled:checked {
background: radial-gradient(circle, var(--fg-faint) 0 2.5px, transparent 3px), var(--border);
}
input[type="radio"]:focus-visible {
outline: 2px solid var(--focus-ring, var(--accent));
outline-offset: 1px;
}
a {
color: var(--link);
}
a:hover {
color: var(--link-hover);
}
/* Focus rings mark controls only, as in IDEA: lists, trees, tables, menus, popups and other
focusable containers show focus through their selected row instead of a frame. Text fields
never get one, whatever their role (a search box is a combobox): their frame shows focus, and
an outline here draws a second box inside it. `:where` keeps this at the specificity of a bare
`:focus-visible`, so a component's own focus style always wins. */
:focus-visible {
outline: none;
}
:where(
button,
a[href],
input:is(
[type="checkbox"],
[type="radio"],
[type="range"],
[type="color"],
[type="file"],
[type="button"],
[type="submit"],
[type="reset"]
),
select,
summary,
[role="button"],
[role="link"],
[role="checkbox"],
[role="radio"],
[role="switch"],
[role="tab"],
[role="combobox"],
[role="slider"],
[role="spinbutton"]
):not(
:where(
input:not(
[type="checkbox"],
[type="radio"],
[type="range"],
[type="color"],
[type="file"],
[type="button"],
[type="submit"],
[type="reset"]
),
textarea,
[contenteditable="true"],
[contenteditable=""]
)
):focus-visible {
outline: 2px solid var(--focus-ring);
outline-offset: -2px;
}
/* A control the user only clicked keeps no ring once a keystroke turns on keyboard modality
(`platform/pointerFocus.ts`); `!important` covers the components' own focus rings. */
[data-pointer-focus]:focus-visible {
outline: none !important;
}
::selection {
background: var(--bg-editor-selection);
}
.mono {
font-family: var(--font-mono);
}
/* Syntax colours for read-only previews and result lines: the `tok-*` classes
CodeMirror's `classHighlighter` emits (`codeHighlighter`/`tokenSpans`). One
shared set instead of a copy per view module; editor tooltips have the same
colours scoped to their DOM in editor/lsp/theme.ts. The main editor is
unaffected: it colours itself with the inline `HighlightStyle` in
editor/core/cm/highlight.ts. */
.tok-keyword,
.tok-modifier,
.tok-controlKeyword,
.tok-operatorKeyword {
color: var(--syn-keyword);
}
.tok-string,
.tok-string2 {
color: var(--syn-string);
}
.tok-number,
.tok-bool,
.tok-atom {
color: var(--syn-number);
}
.tok-typeName,
.tok-className,
.tok-namespace {
color: var(--syn-type);
}
.tok-comment {
color: var(--syn-comment);
font-style: var(--syn-comment-style);
}
.tok-meta,
.tok-macroName {
color: var(--syn-annotation);
}
.tok-propertyName {
color: var(--syn-property);
}
.tok-variableName.tok-definition {
color: var(--syn-function);
}
.tok-punctuation,
.tok-operator {
color: var(--syn-punct);
}
.tok-invalid {
color: var(--syn-invalid);
}
/* macOS-style overlay scrollbars (ScrollBar.Mac.thumbColor / hoverThumbColor) */
::-webkit-scrollbar {
width: 10px;
height: 10px;
background: transparent;
}
::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb);
border: 2px solid transparent;
background-clip: content-box;
border-radius: 6px;
min-height: 32px;
min-width: 32px;
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--scrollbar-thumb-hover);
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
background: transparent;
}
/* Settings › Appearance › Antialiasing (IDE / Editor). */
:root[data-aa-ide="subpixel"] body {
-webkit-font-smoothing: subpixel-antialiased;
}
:root[data-aa-ide="none"] body {
-webkit-font-smoothing: none;
}
:root[data-aa-editor="greyscale"] .cm-editor {
-webkit-font-smoothing: antialiased;
}
:root[data-aa-editor="subpixel"] .cm-editor {
-webkit-font-smoothing: subpixel-antialiased;
}
:root[data-aa-editor="none"] .cm-editor {
-webkit-font-smoothing: none;
}