/* desk/desk.css: the desk colour, the floating card, the inspector and the segmented control. Values copied from Docs internal/docs/views/show.html at Docs origin/main b45b7b2. The app places the card ([estilo-card] sets no position); give it position: fixed or absolute, because its backdrop layer is anchored to it. */ @property --estilo-desk { syntax: ""; inherits: true; initial-value: #e3e7ee; } @property --estilo-desk-ink { syntax: ""; inherits: true; initial-value: #586070; } :root { --estilo-desk: light-dark(#e3e7ee, #0e1015); --estilo-desk-ink: light-dark(#586070, #9aa1ad); --estilo-inspector-inline-size: 248px; /* PUBLIC */ --estilo-inspector-inset: 12px; /* PUBLIC */ } /* The card: glass with the line as its rim. Surface only. */ [estilo-card] { box-sizing: border-box; padding: var(--rst-sp-3); border: 1px solid transparent; border-radius: 12px; background: linear-gradient(light-dark(rgb(255 255 255 / 0.92), rgb(32 35 43 / 0.92)) 0 0) padding-box, linear-gradient(var(--rst-line) 0 0) border-box; box-shadow: inset 0 1px 0 light-dark(rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.06)), 0 2px 4px rgb(23 32 60 / 0.06), 0 10px 20px -8px light-dark(rgb(23 32 60 / 0.18), rgb(0 0 0 / 0.5)), 0 28px 56px -20px light-dark(rgb(23 32 60 / 0.28), rgb(0 0 0 / 0.7)); } /* The blur is drawn by a layer behind the content, not by the card: a backdrop-filter makes its element the containing block of every fixed descendant. */ [estilo-card]::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); pointer-events: none; } [estilo-inspector] { inline-size: var(--estilo-inspector-inline-size); display: flex; flex-direction: column; gap: var(--rst-sp-3); overflow-y: auto; overscroll-behavior: contain; font-size: 13px; } [estilo-inspector][data-state="closed"] { display: none; } [estilo-inspector-group] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2) var(--rst-sp-1); margin: 0; padding: 0; border: 0; } /* A group with nothing showing is not shown. */ [estilo-inspector-group]:not(:has(> :not([estilo-inspector-label], [hidden]))) { display: none; } [estilo-inspector-label] { display: block; flex: 0 0 100%; margin: 0; color: var(--rst-text-muted); font: 650 11px/14px var(--rst-font, system-ui), sans-serif; } /* Selects and fields */ [estilo-inspector] select, [estilo-inspector] input:is([type="text"], [type="number"]) { box-sizing: border-box; min-inline-size: 0; block-size: 28px; padding-inline: var(--rst-sp-2); border: 1px solid var(--rst-line); border-radius: 8px; background: var(--rst-surface); color: var(--rst-text); font-size: 13px; font-weight: 500; text-overflow: ellipsis; } /* The segmented control: a joined row of 28px segments. A segment is a button (aria-pressed) or a label around a radio or checkbox. */ [estilo-seg] { display: flex; flex: 1 1 100%; min-inline-size: 0; } [estilo-seg-item] { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0; box-sizing: border-box; min-inline-size: 24px; min-block-size: 28px; block-size: 28px; padding: 0; border: 0; border-radius: 0; background: var(--rst-surface-2); color: var(--rst-text); font: inherit; line-height: 1; cursor: pointer; } [estilo-seg-item]:nth-child(1 of [estilo-seg-item]) { border-start-start-radius: 8px; border-end-start-radius: 8px; } [estilo-seg-item]:nth-last-child(1 of [estilo-seg-item]) { border-start-end-radius: 8px; border-end-end-radius: 8px; } /* A radio or checkbox inside a segment is the state, not a thing to see. */ [estilo-seg-item] input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; } [estilo-seg-item]:hover:not(:disabled) { background: var(--rst-line); } [estilo-seg-item] svg { inline-size: 18px; block-size: 18px; } [estilo-seg-item]:disabled { color: var(--rst-text-faint); cursor: default; } /* Selected: tint and a complete 1px ring, so colour is not the only sign. A box-shadow costs no layout. */ [estilo-seg-item][aria-pressed="true"], [estilo-seg-item]:has(input:checked) { background: var(--rst-accent-soft); color: var(--rst-accent); font-weight: 700; box-shadow: inset 0 0 0 1px color-mix(in oklab, currentColor 45%, transparent); } [estilo-seg-item]:focus-visible, [estilo-seg-item]:has(input:focus-visible) { outline: 2px solid var(--rst-accent); outline-offset: -2px; } /* Forced colours drop the tint and the ring (a box-shadow). Selection and focus each get their own mark, so a segment that is both shows both: selection is a 2px border (Highlight), focus is an outline 2px outside the segment, raised over its neighbours. */ @media (forced-colors: active) { [estilo-seg-item][aria-pressed="true"], [estilo-seg-item]:has(input:checked) { border: 2px solid Highlight; } [estilo-seg-item]:focus-visible, [estilo-seg-item]:has(input:focus-visible) { z-index: 1; outline: 2px solid Highlight; outline-offset: 2px; } }