.ui-icon-button { width: var(--control-size-icon); height: var(--control-size-icon); margin: 0; padding: 0; flex: none; border: 0; border-radius: calc(var(--radius-icon) * var(--corner-smoothing)); corner-shape: squircle; outline: none; background: transparent; color: var(--text-secondary); display: inline-grid; place-items: center; line-height: 0; cursor: default; transition: color var(--motion-fast), background-color var(--motion-fast), opacity var(--motion-fast); } .ui-icon-button[data-size="compact"] { width: var(--control-size-icon-compact); height: var(--control-size-icon-compact); } .ui-icon-button > svg { width: 16px; height: 16px; pointer-events: none; } .ui-icon-button[data-size="compact"] > svg { width: 13px; height: 13px; } .ui-icon-button:hover:not(:disabled), .ui-icon-button[data-state="open"] { background: var(--control-hover-surface); color: var(--text-primary); } .ui-icon-button:active:not(:disabled) { background: var(--control-pressed-surface); } .ui-icon-button[data-tone="danger"]:hover:not(:disabled) { color: var(--status-danger); } .ui-icon-button[data-tone="primary"] { background: var(--text-primary); color: var(--surface-app); } .ui-icon-button[data-tone="primary"]:hover:not(:disabled) { background: color-mix(in srgb, var(--text-primary) 88%, var(--surface-app)); color: var(--surface-app); } .ui-button { -webkit-appearance: none; appearance: none; min-width: 0; height: var(--control-height-default); margin: 0; padding: 0 var(--space-6); border: 1px solid transparent; border-radius: calc(var(--radius-control) * var(--corner-smoothing)); corner-shape: squircle; outline: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3); color: var(--text-primary); font-size: var(--type-body-compact-size); line-height: var(--type-body-compact-line-height); font-weight: var(--type-body-compact-weight); white-space: nowrap; cursor: pointer; transition: color var(--motion-fast), border-color var(--motion-fast), background-color var(--motion-fast), opacity var(--motion-fast), scale var(--motion-fast); } .ui-button--compact { height: var(--control-height-compact); padding-inline: var(--space-5); font-size: var(--type-caption-size); } .ui-button--primary { background: var(--text-primary); color: var(--surface-app); } .ui-button--secondary { border-color: var(--border-strong); background: var(--surface-panel-raised); } .ui-button--ghost { background: transparent; color: var(--text-secondary); } /* The lead action of a surface that is not a dialog's answer (a toast's Undo, a popover's Done, a card's Accept): it leads its row without the dark slab the primary fill paints, which is kept for the one answer of a dialog. */ .ui-button--tinted { background: var(--control-tinted-surface); color: var(--text-primary); } /* The destructive answer to a confirmation: tinted rather than filled, so it leads the row in either theme without a red slab in the dark one. */ .ui-button--danger { background: var(--status-danger-soft); color: var(--status-danger); } .ui-button--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--text-primary) 88%, var(--surface-app)); } .ui-button--secondary:hover:not(:disabled), .ui-button--ghost:hover:not(:disabled) { background: var(--control-hover-surface); color: var(--text-primary); } .ui-button--tinted:hover:not(:disabled) { background: var(--control-tinted-hover-surface); } .ui-button--danger:hover:not(:disabled) { background: var(--status-danger-soft-hover); } /* Pressed is one step deeper than hover in every variant, and a text button * gives under the pointer. Icon buttons keep still: dense toolbar icons would * move less than a pixel and pay motion cost on every click. */ .ui-button:active:not(:disabled, [aria-disabled="true"]) { scale: 0.97; } .ui-button--primary:active:not(:disabled) { background: color-mix(in srgb, var(--text-primary) 82%, var(--surface-app)); } .ui-button--secondary:active:not(:disabled), .ui-button--ghost:active:not(:disabled) { background: var(--control-pressed-surface); color: var(--text-primary); } .ui-button--tinted:active:not(:disabled) { background: var(--control-tinted-pressed-surface); } .ui-button--danger:active:not(:disabled) { background: var(--status-danger-soft-pressed); } /* Shared visual language for dense selectors. Interaction semantics stay with the caller, so tabs, radio-like filters, and toggle buttons can share one geometry and state treatment without sharing behavior. */ .ui-compact-selectable { --sliding-tab-border: 1px solid var(--border-subtle); --sliding-tab-color: var(--text-secondary); --sliding-tab-hover-color: var(--text-primary); --sliding-tab-active-color: var(--control-active); height: var(--control-height-compact); padding: 0 var(--pad-inline-control); border: var(--sliding-tab-border); border-radius: calc(var(--radius-icon) * var(--corner-smoothing)); corner-shape: squircle; background: transparent; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font-size: var(--type-micro-size); line-height: var(--type-micro-line-height); font-weight: var(--weight-semibold); transition: color var(--motion-fast), border-color var(--motion-fast), background-color var(--motion-fast), opacity var(--motion-fast); } .ui-compact-selectable:hover:not(:disabled):not(.active):not([aria-selected="true"]):not([aria-pressed="true"]):not([aria-checked="true"]) { border-color: var(--border-strong); background: var(--control-hover-surface); color: var(--text-primary); } .ui-compact-selectable:is(.active, [aria-selected="true"], [aria-pressed="true"], [aria-checked="true"]) { border-color: var(--control-active-border); background: var(--control-active-soft); color: var(--control-active); } /* A switch field is one instance of the settings row, so both share the same metrics rather than drifting apart. */ .ui-switch-field, .ui-settings-row { min-width: 0; padding: var(--space-2) 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); } .ui-switch-field-copy, .ui-settings-row-copy { min-width: 0; } .ui-switch-field-label, .ui-settings-row-label { display: block; color: var(--text-primary); font-size: var(--type-body-compact-size); line-height: var(--type-body-compact-line-height); font-weight: var(--type-body-compact-weight); } .ui-switch-field-description, .ui-settings-row-description { margin: var(--space-1) 0 0; color: var(--text-tertiary); font-size: var(--type-caption-size); line-height: var(--type-caption-line-height); font-weight: var(--type-caption-weight); } .ui-settings-row-control { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-4); } /* One control per row, so the shared width keeps every control on a tab flush against the same right edge. */ .ui-settings-row-control > :only-child:where( [data-slot="select-trigger"], [data-slot="input"], [data-slot="textarea"], [data-slot="button"] ) { width: var(--settings-control-width); min-width: var(--settings-control-width); } /* A group keeps the same distance from whatever precedes it on the page, another group or a page-level notice alike. Only the page header sets its own gap below, so every pane's first content starts at one offset. */ * + .ui-settings-group { margin-top: var(--settings-group-gap); } .ui-settings-section-header + .ui-settings-group { margin-top: 0; } /* The heading sits over its group's card; the card, not a rule under the heading, says which rows belong together. */ .ui-settings-group-title { margin: 0 0 var(--space-4); color: var(--text-primary); font-size: var(--type-subtitle-size); line-height: var(--type-subtitle-line-height); font-weight: var(--weight-semibold); } /* A group's rows share one card: a hairline edge, a hairline between rows, and one height for every single-line row (a 32px control and its inset), so the dividers fall at a single rhythm down the page. What sits among the rows without being one (a key's form, a notice) takes the same inset. A group holding no row at all is laid out by its feature. */ .ui-settings-group-body:has(> :is(.ui-settings-row, .ui-switch-field)) { border: 1px solid var(--border-subtle); border-radius: calc(var(--settings-card-radius) * var(--corner-smoothing)); corner-shape: squircle; background: var(--settings-card-surface); overflow: clip; } .ui-settings-group-body:has(> :is(.ui-settings-row, .ui-switch-field)) > * { margin: 0; padding: var(--space-6) var(--settings-card-padding-inline); } /* Drawn inside the row rather than as a border, so a divider never adds to the height of the row under it. */ .ui-settings-group-body:has(> :is(.ui-settings-row, .ui-switch-field)) > * + * { box-shadow: inset 0 1px 0 var(--border-subtle); } .ui-settings-group-body:has(> :is(.ui-settings-row, .ui-switch-field)) > :is(.ui-settings-row, .ui-switch-field) { min-height: var(--settings-row-min-height); padding-block: var(--space-5); } .ui-row { min-height: var(--row-height-default); } .ui-row--store { min-height: var(--row-height-comfortable); } .ui-panel-header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); } .ui-panel-header-title { min-width: 0; display: flex; align-items: center; gap: var(--space-4); color: var(--text-primary); font-size: var(--type-subtitle-size); line-height: var(--type-subtitle-line-height); font-weight: var(--type-subtitle-weight); } .ui-panel-header-title > svg { flex: none; } .ui-panel-header-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ui-panel-header-actions { margin-left: auto; flex: none; display: flex; align-items: center; gap: var(--space-2); } .ui-settings-section-header { min-width: 0; margin: 0 0 var(--space-12); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-6); } .ui-settings-section-header-copy { min-width: 0; } .ui-settings-section-header-title { margin: 0; color: var(--text-primary); font-family: var(--type-title-font); font-size: var(--type-title-size); line-height: var(--type-title-line-height); font-weight: var(--type-title-weight); } .ui-settings-section-header-description { max-width: 54ch; margin: var(--space-3) 0 0; color: var(--text-secondary); font-size: var(--type-caption-size); line-height: var(--type-caption-line-height); font-weight: var(--type-caption-weight); } /* Held to the title's line box, so a header action (taller than the title line) centres on the title without pushing the page's content down. */ .ui-settings-section-header-actions { height: var(--type-title-line-height); flex: none; display: flex; align-items: center; gap: var(--space-2); } .ui-empty-state { min-width: 0; padding: var(--space-8); color: var(--text-tertiary); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; } /* A filling state grows into the rest of a flex column and centres there, never shrinking below its content, so a column too short for it scrolls. A ScrollArea stretches its content to the viewport for one (scroll-area.css), and a drawer becomes that column (surfaces.css). */ .ui-empty-state[data-fill] { flex: 1 0 auto; justify-content: center; } .ui-empty-state[data-density="compact"] { padding: var(--space-3) 0; gap: var(--space-2); } .ui-empty-state[data-align="start"] { align-items: flex-start; text-align: left; } .ui-empty-state-icon { color: var(--text-tertiary); line-height: 0; } .ui-empty-state-title { margin: 0; color: var(--text-primary); font-size: var(--type-subtitle-size); line-height: var(--type-subtitle-line-height); font-weight: var(--type-subtitle-weight); } .ui-empty-state-description { max-width: 52ch; margin: 0; color: inherit; font-size: var(--type-caption-size); line-height: var(--type-caption-line-height); font-weight: var(--type-caption-weight); } /* Centred lines balance, so a wrap never leaves one word under the rest. */ .ui-empty-state[data-align="center"] .ui-empty-state-description { text-wrap: balance; } .ui-empty-state-description code { padding: 0 var(--space-1); border-radius: var(--radius-compact); background: var(--control-active-soft); color: var(--text-secondary); font-family: var(--editor-font); font-size: .95em; white-space: nowrap; } .ui-empty-state-actions { margin-top: var(--space-2); display: flex; align-items: center; justify-content: center; gap: var(--space-3); } .ui-checkbox { appearance: none; width: var(--control-size-checkbox); height: var(--control-size-checkbox); min-width: var(--control-size-checkbox); margin: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-compact); outline: none; background: var(--surface-app); color: var(--surface-app); display: inline-grid; place-content: center; flex: none; cursor: pointer; transition: border-color var(--motion-fast), background-color var(--motion-fast), opacity var(--motion-fast); } .ui-checkbox:hover:not(:disabled) { border-color: var(--control-hover-border); } .ui-checkbox:checked, .ui-checkbox[data-state="indeterminate"] { border-color: var(--control-on-surface); background: var(--control-on-surface); } .ui-checkbox:checked::before { content: ""; width: 7px; height: 4px; border-bottom: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: translateY(-1px) rotate(-45deg); } .ui-checkbox[data-state="indeterminate"]::before { content: ""; width: 7px; height: 1.5px; border-radius: var(--radius-pill); background: currentColor; } /* Checkboxes are inputs, which the global rule leaves to the field contract, so the shared ring is applied here explicitly. */ .ui-checkbox:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring); outline-offset: var(--focus-ring-offset); } label.ui-checkbox-field[data-slot="checkbox-field"] { min-width: 0; margin: 0; display: inline-flex; flex-direction: row; align-items: flex-start; gap: var(--space-3); color: var(--text-secondary); font-size: var(--type-caption-size); line-height: var(--type-caption-line-height); font-weight: var(--type-body-compact-weight); cursor: pointer; } .ui-checkbox-field:has(.ui-checkbox:disabled) { cursor: not-allowed; } .ui-checkbox-field-copy { min-width: 0; display: grid; gap: var(--space-1); } .ui-checkbox-field-label { color: inherit; } .ui-checkbox-field-description { color: var(--text-tertiary); font-size: var(--type-micro-size); line-height: var(--type-micro-line-height); font-weight: var(--type-caption-weight); } .ui-segmented { /* Tabs sit flush inside the track, so their radius follows from these two. See the concentric nesting note in styles/surfaces.css. */ --surface-radius: var(--radius-control); --surface-inset: var(--space-1); height: var(--control-height-compact); padding: var(--surface-inset); border-radius: calc(var(--surface-radius) * var(--corner-smoothing)); corner-shape: squircle; background: var(--segmented-surface); display: flex; align-items: stretch; flex: none; } .ui-segmented--default { height: var(--control-height-default); } .ui-segmented-tab { min-width: 0; height: 100%; padding: 0 var(--segmented-tab-padding-inline); border-radius: calc(var(--nested-radius) * var(--nested-corner-smoothing, 1)); corner-shape: var(--nested-corner-shape, round); display: inline-flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: var(--type-micro-size); line-height: var(--type-micro-line-height); font-weight: var(--weight-medium); text-transform: none; } .ui-segmented--default .ui-segmented-tab { flex: 1 1 0; font-size: var(--type-caption-size); line-height: var(--type-caption-line-height); font-weight: var(--weight-semibold); } .ui-segmented .sliding-tab-pill { border: 0; background: var(--segmented-selected-surface); box-shadow: var(--segmented-selected-shadow); } /* A track of pressed buttons (filters rather than tabs) has no sliding pill: the pressed one carries the pill's surface itself. */ .ui-segmented-tab[aria-pressed] { border: 0; background: transparent; transition: color var(--motion-fast), background-color var(--motion-fast); } .ui-segmented-tab[aria-pressed="false"]:hover { color: var(--text-secondary); } .ui-segmented-tab[aria-pressed="true"] { background: var(--segmented-selected-surface); box-shadow: var(--segmented-selected-shadow); color: var(--text-primary); } .ui-icon-button:disabled, .ui-compact-selectable:disabled, .ui-checkbox:disabled { opacity: var(--control-disabled-opacity); cursor: not-allowed; } /* One disabled Button for every variant (foundations.css). */ .ui-button:is(:disabled, [aria-disabled="true"], [data-disabled]) { border-color: var(--control-disabled-border); background: var(--control-disabled-surface); color: var(--control-disabled-ink); cursor: not-allowed; } /* Badge, inline message and switch. Layered, like the StyleX rules they replace, so a feature stylesheet's unlayered spacing or plate still wins. */ @layer components { .ui-badge { height: var(--badge-height); min-width: 0; padding-block: 0; padding-inline: var(--space-3); border-radius: var(--radius-icon); background-color: var(--border-subtle); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font-size: var(--type-micro-size); font-style: normal; font-weight: var(--type-micro-weight); line-height: var(--type-micro-line-height); white-space: nowrap; } .ui-badge[data-size="compact"] { height: var(--badge-height-compact); padding-inline: var(--space-2); } .ui-badge[data-tone="success"] { background-color: var(--status-success-soft); color: var(--status-success); } .ui-badge[data-tone="warning"] { background-color: var(--status-warning-soft); color: var(--status-warning); } .ui-inline-message { min-width: 0; margin: 0; display: flex; align-items: flex-start; gap: var(--space-3); color: var(--text-secondary); font-size: var(--type-caption-size); font-weight: var(--type-caption-weight); line-height: var(--type-caption-line-height); overflow-wrap: anywhere; } .ui-inline-message.error { color: var(--text-primary); } /* The 13px icon sits centred on the first line of text. */ .ui-inline-message-icon { flex: 0 0 auto; margin-top: calc((var(--type-caption-line-height) - 13px) / 2); } .ui-inline-message.info .ui-inline-message-icon { color: var(--status-info); } .ui-inline-message.success .ui-inline-message-icon { color: var(--status-success); } .ui-inline-message.warning .ui-inline-message-icon { color: var(--status-warning); } .ui-inline-message.error .ui-inline-message-icon { color: var(--status-danger); } .ui-inline-message-copy { min-width: 0; } .ui-switch { width: var(--control-width-switch); height: var(--control-height-switch); margin: 0; padding: var(--space-1); flex: 0 0 auto; border: none; border-radius: var(--radius-pill); outline: none; background-color: var(--control-off-surface); cursor: pointer; transition: background-color var(--motion-moderate), opacity var(--motion-fast); } .ui-switch[aria-checked="true"] { background-color: var(--control-on-surface); } .ui-switch:disabled { cursor: not-allowed; opacity: var(--control-disabled-opacity); } .ui-switch-thumb { width: var(--control-size-switch-thumb); height: var(--control-size-switch-thumb); border-radius: var(--radius-pill); background-color: var(--control-thumb-surface); display: block; } } /* The tooltip's entrance: a short fade and grow from 98%, drifting a few pixels in from the side it opens on. Only open states animate, so a closed tooltip unmounts at once and never lingers under the next one. */ @keyframes ui-tooltip-enter { from { opacity: 0; transform: translate3d(var(--ui-tooltip-enter-x, 0), var(--ui-tooltip-enter-y, 0), 0) scale3d(0.98, 0.98, 0.98); } } @layer components { .ui-tooltip-content:is([data-state="delayed-open"], [data-state="instant-open"]) { animation: ui-tooltip-enter var(--motion-fast); } .ui-tooltip-content[data-side="bottom"] { --ui-tooltip-enter-y: calc(-1 * var(--space-2)); } .ui-tooltip-content[data-side="top"] { --ui-tooltip-enter-y: var(--space-2); } .ui-tooltip-content[data-side="left"] { --ui-tooltip-enter-x: var(--space-2); } .ui-tooltip-content[data-side="right"] { --ui-tooltip-enter-x: calc(-1 * var(--space-2)); } /* A tooltip only describes its trigger and floats above every other layer, menus included, so neither it nor Radix's positioning wrapper may take pointer input from a control it happens to cover. */ [data-radix-popper-content-wrapper]:has(> .ui-tooltip-content), .ui-tooltip-content { pointer-events: none; } } /* A tooltip's shortcut (Tip's `shortcut`) is text, as in a menu: the secondary ink after the label it follows, and never wrapped away from it. */ .ui-tooltip-shortcut { margin-inline-start: var(--space-4); color: var(--text-secondary); font-weight: var(--weight-regular); white-space: nowrap; } /* A key combination as keycaps (keycaps.tsx): one cap per key, quiet enough to sit beside a label or inside a ghost button. */ .ui-keycaps { display: inline-flex; align-items: center; gap: var(--space-1); font: inherit; } .ui-keycap { min-width: 18px; height: 18px; padding: 0 var(--space-2); border: 1px solid var(--border-subtle); border-radius: calc(var(--radius-compact) * var(--corner-smoothing)); corner-shape: squircle; background: var(--surface-panel-raised); box-shadow: 0 1px 0 var(--border-subtle); color: var(--text-secondary); display: inline-grid; place-items: center; font-family: var(--ui-font); font-size: var(--type-caption-size); font-weight: var(--weight-medium); line-height: var(--type-caption-line-height); } /* In a long list (a picker or the palette) a combination reads as one quiet word, ⌘⇧K, as a menu writes it: a column of boxed caps on every row was the loudest thing in the list. The caps stay `kbd`s, so the markup still says which keys they are. */ .ui-keycaps-run { gap: 1px; color: var(--text-secondary); } .ui-keycaps-run .ui-keycap { min-width: 0; height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; color: inherit; font-weight: var(--weight-regular); font-variant-numeric: tabular-nums; }