118 lines
4.4 KiB
CSS
118 lines
4.4 KiB
CSS
/* Shell-owned mount defaults. Theme tokens arrive with the ui-theme client
|
|
* plugin before the loader roster activates. */
|
|
|
|
html,
|
|
body,
|
|
#root {
|
|
height: 100%;
|
|
margin: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: var(
|
|
--dsw-font-family,
|
|
-apple-system,
|
|
BlinkMacSystemFont,
|
|
'Segoe UI',
|
|
'PingFang SC',
|
|
'Hiragino Sans GB',
|
|
'Microsoft YaHei',
|
|
'Helvetica Neue',
|
|
Helvetica,
|
|
Arial,
|
|
sans-serif
|
|
);
|
|
/* Grayscale antialiasing over subpixel rendering: WebKit/Blink and the
|
|
Firefox macOS equivalent; other engines ignore both lines. */
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
color: var(--dsw-alias-label-primary, #0f1115);
|
|
background: var(--dsw-alias-bg-base, #fff);
|
|
/* Supporting browsers insert CJK/Latin spacing in inherited prose. */
|
|
text-autospace: normal;
|
|
}
|
|
|
|
/* macOS desktop (the Electron preload sets data-platform): the window's
|
|
sidebar vibrancy shows only through a transparent page background. */
|
|
html[data-platform='darwin'],
|
|
html[data-platform='darwin'] body {
|
|
background: transparent;
|
|
}
|
|
|
|
/* Menu backings paint below page content but above the native vibrancy. */
|
|
html[data-platform='darwin'] body {
|
|
isolation: isolate;
|
|
}
|
|
|
|
/* macOS desktop: the one drag declaration. A chrome row marks itself in markup
|
|
(`data-window-drag`) and its own box becomes its draggable geometry, so no fixed
|
|
band has to match any row's height; the ui-theme app-region gate's CHROME_ROWS
|
|
manifest is the list of rows that must carry the mark. Electron composes
|
|
app-regions from geometry, not hit testing, so a surface covering a row would
|
|
otherwise drag the window instead of receiving clicks; every covering overlay
|
|
portals to document.body beside #root, which also puts it after every drag row
|
|
in document order, and one rule subtracts them all. */
|
|
html[data-platform='darwin'] [data-window-drag] {
|
|
-webkit-app-region: drag;
|
|
}
|
|
|
|
/* One-frame app-region pulse that forces Electron to recollect the window's drag
|
|
rects (electron#32341): a change to a computed app-region value is what dirties
|
|
them. The shell's window drag watcher (window-drag/recall.ts) sets this
|
|
attribute on the body for each frame in which a marked row's box moved, and
|
|
clears it on the frame that finds the geometry settled. The box it subtracts
|
|
is the body's own: the row marks inside still declare drag and win over it in
|
|
document order, so the pulse changes nothing about the composed surface — it
|
|
only makes Electron collect it again. */
|
|
html[data-platform='darwin'] [data-window-drag-recall] {
|
|
-webkit-app-region: no-drag;
|
|
}
|
|
|
|
html[data-platform='darwin'] body > :not(#root) {
|
|
-webkit-app-region: no-drag;
|
|
}
|
|
|
|
/* Inside #root, interactive controls and raised surfaces (dialogs, menus)
|
|
subtract themselves from any drag row they overlap, wherever they render.
|
|
Electron composes app-regions from geometry in document order, so a drag rule
|
|
must sit on a chrome row that precedes the overlays covering it — never on a
|
|
content container, which would override every overlay mounted earlier in the
|
|
DOM. One selector on the native elements, ARIA roles, and tabindexed custom
|
|
widgets replaces per-component no-drag opt-outs. */
|
|
html[data-platform='darwin'] :is(
|
|
button, a, input, select, textarea, summary, [contenteditable='true'], [tabindex],
|
|
[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox'], [role='tooltip'],
|
|
[role='button'], [role='link'], [role='tab'], [role='menuitem'], [role='menuitemcheckbox'],
|
|
[role='menuitemradio'], [role='option'], [role='checkbox'], [role='radio'], [role='switch'],
|
|
[role='slider'], [role='combobox'], [role='textbox']
|
|
) {
|
|
-webkit-app-region: no-drag;
|
|
}
|
|
|
|
/* Reset both native region types for inert content. Chromium treats the explicit
|
|
`none` keyword as `no-drag`, which would erase foreground drag rows. */
|
|
html[data-platform='darwin'] [inert],
|
|
html[data-platform='darwin'] [inert] * {
|
|
-webkit-app-region: initial;
|
|
}
|
|
|
|
code,
|
|
pre,
|
|
[data-diff],
|
|
[data-read],
|
|
[data-search],
|
|
[data-terminal] {
|
|
/* Literal payloads retain source spacing and column alignment. */
|
|
text-autospace: no-autospace;
|
|
}
|
|
|
|
/* Form controls don't inherit the body font (UA sheets pin their families —
|
|
Chrome buttons fall back to Arial, textareas to monospace), so the app
|
|
stack is re-applied to them explicitly, as upstream's global reset does. */
|
|
button,
|
|
input,
|
|
select,
|
|
textarea {
|
|
font-family: inherit;
|
|
}
|