130 lines
4.8 KiB
CSS
130 lines
4.8 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;
|
|
}
|
|
|
|
/* The shipped Electron runtime inherits app-region and collects full boxes
|
|
without overflow clips. Only explicit owners contribute geometry, so clipped
|
|
descendants cannot subtract a chrome row after scrolling outside its view. */
|
|
:where(html[data-platform='darwin'] *) {
|
|
-webkit-app-region: initial;
|
|
}
|
|
|
|
/* 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 covering overlays must subtract
|
|
their boxes after the row in document order. Body portals sit after #root;
|
|
their root boxes are excluded below. */
|
|
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;
|
|
}
|
|
|
|
/* An interactive viewport without nested drag rows owns one box; its clipped
|
|
descendants do not.
|
|
Containers with nested drag rows must instead declare their own region. */
|
|
html[data-platform='darwin'] [data-window-drag-exclude] {
|
|
-webkit-app-region: no-drag;
|
|
}
|
|
|
|
/* Controls subtract themselves only inside a chrome row. Scrollable content
|
|
outside those rows needs no region, even when it is keyboard-focusable.
|
|
Covering overlays own their no-drag box through the body rule above or an
|
|
explicit component declaration. A controls scope also covers the onboarding
|
|
stage whose window-wide drag band is a preceding sibling. */
|
|
html[data-platform='darwin'] :where([data-window-drag], [data-window-drag-controls]) :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']
|
|
):where(:not([data-window-drag-exclude] *)) {
|
|
-webkit-app-region: no-drag;
|
|
}
|
|
|
|
/* Reset both native region types for inert content. In the shipped Electron
|
|
runtime, authored `none` computes to `no-drag`; `initial` computes to `none`
|
|
and contributes no box, so it cannot 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;
|
|
}
|