Skip to content

AI media harness for planning, generating, and editing locally

TypeScript
6.6 KB
Raw Blame
/* ============================================================================
   base.css — reset, document defaults, element defaults, focus, utilities.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg);
  font-synthesis: none;
}

html,
body,
#root {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  /* Nothing in an editor is selected by dragging across it. Every surface here
     is a control — clips are dragged, panels are scrolled, the ruler is
     scrubbed — and a gesture that misses one used to leave a blue smear across
     whatever it crossed. Selection belongs to the places text is TYPED, which
     the rule below gives it back to. */
  user-select: none;
}

/* `hidden` means hidden. The UA rule is a plain `display: none` that any
   component rule setting `display` outranks, and the app keeps several panes
   mounted-but-hidden (the agent pane, the screen behind Settings) — without
   this, a closed agent pane still took the bottom of the window. */
[hidden] {
  display: none !important;
}

/* Where text is written, it is text: selecting, double-clicking a word and
   dragging through a value all keep working. */
input,
textarea,
select,
[contenteditable="true"] {
  user-select: text;
}

/* --- Prose defaults -------------------------------------------------------- */

p,
li,
dd {
  line-height: var(--leading-normal);
}

h1,
h2,
h3,
h4 {
  line-height: var(--leading-tight);
}

/* Titles use the Display optical size of Segoe UI Variable, which is drawn
   for 20px and up. h4 is used for small in-panel labels, so it stays on the
   Text cut. */
h1,
h2,
h3 {
  font-family: var(--font-display);
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

/* --- Form / interactive element defaults ----------------------------------- */

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: inherit;
}

button {
  color: inherit;
}

/* The arrow, everywhere. On Windows the hand cursor means "this is a
   hyperlink" and nothing else; a button, a tab, a card or a checkbox shows the
   arrow and answers with a fill change instead. A disabled control shows the
   arrow too — Windows has no "not allowed" cursor for a greyed-out button.
   Other sheets set only the cursors that mean something: grab/grabbing on a
   drag handle, the resize arrows on a splitter, text on a text surface. */
button,
select,
label,
summary,
[role="button"],
[role="tab"],
[role="option"],
[role="menuitem"],
input[type="checkbox"],
input[type="radio"],
input[type="range"],
input[type="color"],
input[type="file"],
:disabled {
  cursor: default;
}

a[href] {
  cursor: pointer;
}

/* Images and links are not drag sources in a native app: dragging a thumbnail
   used to pick up a ghost of the file URL. Rows and cards that ask to be
   dragged (draggable="true") still drag — the drag falls through the image to
   the ancestor that is the real source. */
img,
a {
  -webkit-user-drag: none;
}

input,
textarea,
select {
  color: var(--text-primary);
}

/* The dropdown list a <select> opens is painted by the platform, not by this
   stylesheet, and it takes its colours from the select itself. A select with a
   transparent background got a white menu with grey text on Windows. Both
   sides are now stated outright; `color-scheme` is NOT restated here because
   tokens.css sets it per theme on :root and it inherits — pinning it to `dark`
   again would give a light-theme user a dark platform menu. */
select {
  background-color: var(--panel-2);
}

option {
  color: var(--text-primary);
  background-color: var(--panel-2);
}

::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

/* --- Focus -----------------------------------------------------------------
   The Fluent focus visual, for the keyboard only: a 2px ring in the text
   colour (--focus-outer) standing 1px off the control, with that 1px gap
   filled by --focus-inner so the ring reads on any fill, the accent included.
   The outline is the outer ring; a box-shadow spread is the inner one.

   Text inputs are deliberately NOT in this list. Chromium matches
   input:focus-visible on a mouse click, so a ring there drew every time a
   field was clicked; a Fluent TextBox shows focus as a 2px accent underline
   instead (controls.css), and composite fields (search, composer, dock)
   draw that underline on their wrapper. */
button:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="range"]:focus-visible,
input[type="color"]:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-outer);
  outline-offset: 1px;
  box-shadow: 0 0 0 1px var(--focus-inner);
}

input:focus-visible:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="button"], [type="submit"]),
textarea:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Activity indicators must still distinguish working from stalled when
     Windows disables interface animations. Keep only this small, slower
     rotation; decorative motion and transitions remain disabled. */
  .icon-button--busy::before,
  .ui-ring--indeterminate svg {
    animation-duration: 1.8s !important;
    animation-iteration-count: infinite !important;
  }
}

/* --- Utilities ------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.spinner {
  width: 16px;
  height: 16px;
  /* The spinner only ever appears inside a primary (blue) button, which is
     blue in both themes, so it wears the on-accent pair rather than a
     theme-dependent grey. */
  border: 2px solid var(--on-accent-dim);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* --- Animations ------------------------------------------------------------ */

@keyframes spin {
  to { transform: rotate(360deg); }
}