@import 'tailwindcss/theme.css'; @import './preflight.css'; @import 'tailwindcss/utilities.css'; @import 'tw-animate-css'; @import './tailwind.theme.css'; @import './theme-variables.css'; @layer base { /* Placeholder that only matches a locally installed Inter; Admin and Storybook load the font files */ @font-face { font-family: 'Inter'; src: local('Inter') format('truetype-variations'); font-weight: 100 900; } .shade { & { @apply font-sans text-black text-base leading-normal; } } * { @apply border-border; } /* The body's reset sits here, not in preflight.css: preflight is scoped to .shade, which is inside body. In this layer, an app's unlayered body styles, or a later base-layer rule, win over it. */ body { margin: 0; @apply font-sans antialiased bg-background text-foreground; } } /* admin7Design: a heading for a section inside a page, one step below the page's title. Comes after the utilities at their specificity, so it beats text classes. */ .section-heading:where([data-admin7-design='true'] *) { font-size: var(--text-section-heading); font-weight: var(--font-weight-medium); letter-spacing: var(--tracking-section-heading); line-height: 1.35; font-variation-settings: 'opsz' 28, 'wght' var(--font-weight-medium); font-feature-settings: 'dlig', 'zero', 'ss01', 'ss02', 'cv10', 'cv06'; } /* Settings headings share weight and tracking without changing headings on member and tag details. Large Settings titles keep their own size. */ .settings-heading:where([data-admin7-design='true'] *) { font-weight: var(--font-weight-settings-heading); letter-spacing: var(--tracking-settings-heading); } .section-heading.settings-heading:where([data-admin7-design='true'] *) { font-variation-settings: 'opsz' 28, 'wght' var(--font-weight-settings-heading); } /* admin7Design: a small label above a stat or a value, and a large, light number for stats. Any unit inside the number is the number's size too. */ .stat-label:where([data-admin7-design='true'] *) { color: var(--text-secondary); font-size: 13px; font-weight: 400; line-height: 1; } .stat-value:where([data-admin7-design='true'] *) { font-size: 32px; font-weight: 400; letter-spacing: -0.025em; line-height: 1; font-variation-settings: 'opsz' 36, 'wght' 400; & > span { color: inherit; font-size: inherit; } } /* admin7Design: the label style of column headers, whichever element holds them. Comes after the utilities at their specificity, so it beats their text classes but not a parent's, like the Members list's hidden sizing header. A TableHead used as a row title is not a column header. */ .column-label:where([data-admin7-design='true'] :not([scope='row'])) { color: var(--text-secondary); font-size: 10px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; } /* admin7Design: banners are a flat color with darker shades of it for text and no outline. Text inside takes those shades, whichever tone it asks for. */ [data-admin7-design='true'] [data-slot='banner']:is( [data-variant='info'], [data-variant='success'], [data-variant='warning'], [data-variant='destructive'] ) { --foreground: var(--banner-foreground); --text-primary: var(--banner-foreground); --text-secondary: var(--banner-secondary); --muted-foreground: var(--banner-secondary); --state-warning: var(--banner-secondary); border-color: transparent; background-color: var(--banner-surface); color: var(--banner-foreground); } [data-admin7-design='true'] [data-slot='banner'][data-variant='info'] { --banner-surface: var(--banner-info-surface); --banner-foreground: var(--banner-info-foreground); --banner-secondary: var(--banner-info-secondary); } [data-admin7-design='true'] [data-slot='banner'][data-variant='success'] { --banner-surface: var(--banner-success-surface); --banner-foreground: var(--banner-success-foreground); --banner-secondary: var(--banner-success-secondary); } [data-admin7-design='true'] [data-slot='banner'][data-variant='warning'] { --banner-surface: var(--banner-warning-surface); --banner-foreground: var(--banner-warning-foreground); --banner-secondary: var(--banner-warning-secondary); } [data-admin7-design='true'] [data-slot='banner'][data-variant='destructive'] { --banner-surface: var(--banner-destructive-surface); --banner-foreground: var(--banner-destructive-foreground); --banner-secondary: var(--banner-destructive-secondary); } .shade { line-height: 1.5; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; letter-spacing: unset; } .shade.app-container { height: 100vh; width: 100%; overflow-x: hidden; overflow-y: auto; } .dark .shade { color: var(--foreground); } /* Suppress transitions/animations during a light/dark mode swap so the whole UI flips in a single paint instead of crossfading per element. */ html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; animation-duration: 0s !important; animation-delay: 0s !important; } .shade .no-scrollbar::-webkit-scrollbar { display: none; /* Chrome */ } .shade .no-scrollbar { -ms-overflow-style: none; /* IE and Edge */ scrollbar-width: none; /* Firefox */ } /* In a Ghost app the document scrolls. Radix's scroll lock hides its scrollbar and pads body, shifting what's fixed to the window; keep the scrollbar, as the lock still blocks scrolling. */ :root[style*='--ghost-safe-area-inset-'] > body[data-scroll-locked] { overflow: visible !important; margin-right: 0 !important; } /* Set by useSafeAreaSlide */ :root[data-ghost-safe-area-sliding] { overflow-x: clip; } /* Set by FloatingSidebar: over a cross-origin frame, pointer events go to the frame alone. */ [data-floating-sidebar-frame-guard] ~ * iframe { pointer-events: none !important; } /* CodeEditor autocomplete is portalled to a viewport-sized body child so it can escape form-control and accordion overflow boundaries. CodeMirror adds an intermediate container carrying the editor theme classes; collapse and clear that container so those classes cannot paint a full-screen surface. */ .cm-tooltip-parent > * { height: 0 !important; background: none !important; } .cm-tooltip-parent .cm-tooltip { pointer-events: auto; } .cm-tooltip-parent .cm-tooltip-autocomplete.cm-tooltip ul li:not([aria-selected]) { background: var(--background); } /* A page's large title (e.g. a list page's, ListPage with large titles on): the space above it and its size grow with the window. - space: 28px at 600px tall, 100px from 900px. Admin follows the space beside the page's content instead (admin-layout.tsx). - size: 28px at 800px wide, 44px from 1380px. Admin follows the page area's width instead (admin-layout.tsx). - size, a step down: 8/11 of it (32px at most, not under 20px), for titles that can run long, like a post's */ :root { --large-title-space: clamp(28px, calc(24vh - 116px), 100px); --large-title-size: clamp(28px, calc(2.76vw + 6px), 44px); --large-title-size-sm: max(20px, calc(var(--large-title-size) * 8 / 11)); } /* A list page's large title handing over to its sticky header as the page scrolls (ListPage, with large titles on): the title eases out over the first half of the handover, the header's solid background eases in over the second, and once the header has stuck (data-condensed), its small title fades in in its own time, however fast the page is scrolling. Tied to scrolling by the browser where it can, so in step with it; elsewhere by --large-title-condense (useLargeTitleCondense). */ @keyframes large-title-out { from { opacity: 1; animation-timing-function: ease-in; } 50%, to { opacity: 0; } } @keyframes large-title-row-settle { from { translate: 0 0; animation-timing-function: ease-out; } 50%, to { translate: 0 8px; } } @keyframes large-title-in { from, 50% { opacity: 0; animation-timing-function: ease-out; } to { opacity: 1; } } /* Out quickly as the large title comes back; in slowly once it has gone */ .large-title-header-title { opacity: 0; transition: opacity 150ms ease-out; } [data-large-title-header][data-condensed] .large-title-header-title { opacity: 1; transition-duration: 450ms; } @media (prefers-reduced-motion: reduce) { .large-title-header-title { transition: none; } } @supports (animation-timeline: view()) { [data-large-title-host] { timeline-scope: --large-title-handover; } [data-large-title-marker] { view-timeline: --large-title-handover block; } [data-large-title], [data-large-title-header]::before, [data-large-title-header] [data-page-header='main'] { animation-duration: auto; animation-fill-mode: both; animation-timing-function: linear; animation-timeline: --large-title-handover; animation-range: exit; } [data-large-title] { animation-name: large-title-out; } [data-large-title-header]::before { animation-name: large-title-in; } /* The header's first row settles into place as it sticks, padding moving from below it to above it */ [data-large-title-header] [data-page-header='main'] { animation-name: large-title-row-settle; } } @supports not (animation-timeline: view()) { [data-large-title] { opacity: clamp(0, calc(1 - var(--large-title-condense, 0) * 2), 1); } [data-large-title-header]::before { opacity: clamp(0, calc(var(--large-title-condense, 0) * 2 - 1), 1); } [data-large-title-header] [data-page-header='main'] { translate: 0 calc(min(var(--large-title-condense, 0) * 2, 1) * 8px); } } /* With reduced motion, the header's first row doesn't move with the scroll: it takes its settled place as the header sticks */ @media (prefers-reduced-motion: reduce) { [data-large-title-header] [data-page-header='main'] { animation: none; translate: none; } [data-large-title-header][data-condensed] [data-page-header='main'] { translate: 0 8px; } } /* Under a large title, the header's first row (its PageHeader) sits 32px above a separator; a FilterBar following it takes the separator's place, and anything else follows 24px below. The header's own row gaps give way to these, wherever the page groups its rows. */ [data-large-title-header], [data-large-title-header] :has(> [data-page-header='page-header']) { row-gap: 0; } [data-large-title-header] [data-page-header='page-header'] { padding-bottom: 32px; border-bottom: 1px solid var(--border); } [data-large-title-header] [data-page-header='page-header']:has(~ [data-slot='filter-bar']) { border-bottom-width: 0; } /* Once the header has stuck, its solid background is the edge on its own. Transparent rather than gone, so the header doesn't shift as it sticks. */ [data-large-title-header][data-condensed] [data-page-header='page-header'] { border-bottom-color: transparent; } [data-large-title-header] [data-page-header='page-header'] ~ * { margin-top: 24px; } [data-large-title-header] [data-page-header='page-header'] ~ [data-slot='filter-bar'] { margin-top: 0; } /* With large titles on, a list page's table labels are 44px tall and stick beneath the header (--list-page-header-height, set by ListPage, plus --list-page-header-top for a header that sticks above the top, set by the page), on a solid background with their own bottom line; a clipping wrapper clips without becoming what they'd stick to. A table that pins its labels itself opts out with data-table-labels="pinned" on an ancestor. */ [data-large-title-host] [data-list-page='body'] .overflow-hidden:has(table) { overflow: clip; } [data-large-title-host] [data-list-page='body'] table:not([data-table-labels='pinned'] table) > thead th { position: sticky; top: calc(var(--list-page-header-height, 0px) + var(--list-page-header-top, 0px)); /* Above cells raised for their links (z-10), below the header (z-50). */ z-index: 20; height: 44px; background-color: var(--background); box-shadow: inset 0 -1px 0 var(--border); } [data-large-title-host] [data-list-page='body'] table:not([data-table-labels='pinned'] table) > thead tr { border-bottom-width: 0; } /* A list's own top border would double the separator above it (a filter bar in the separator's place keeps it) */ [data-large-title-host]:has([data-large-title-header]):not( :has([data-large-title-header] [data-slot='filter-bar']) ) [data-list-page='body'] > :first-child:is(.border-t), [data-large-title-host]:has([data-large-title-header]):not( :has([data-large-title-header] [data-slot='filter-bar']) ) [data-list-page='body'] > :first-child > :first-child:is(.border-t) { border-top-width: 0; } /* Shared content-row chrome. The recipe opts rows in explicitly; DataList, menus and navigation do not use these classes. Keep this in the published stylesheet so apps receive the same behavior without scanning Shade source. */ /* A responsive table can hide its trailing cells. Mark the visible end with this utility (e.g. max-sm:shade-row-end) at the same breakpoint. */ @utility shade-row-end { tr.shade-row > & { padding-inline-end: 0; } tr.shade-row > &::before { inset-inline-end: calc(-4 * var(--spacing)); border-start-end-radius: var(--radius-md); border-end-end-radius: var(--radius-md); } tr.shade-row-inset > &::before { inset-inline-end: 0; } } .shade-row { position: relative; isolation: isolate; background-color: transparent; } .shade-row::before, tr.shade-row > :is(td, th)::before { content: ''; display: block; position: absolute; inset: 0 calc(-4 * var(--spacing)); z-index: -1; border-radius: var(--radius-md); background-color: var(--table-row-hover); opacity: 0; pointer-events: none; } :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) )::before, tr:is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ) > :is(td, th)::before { /* Keep row targets subject to a modal's inherited pointer blocking. */ pointer-events: inherit; } /* A native primary link/button stretches over blank row space and the side gutters. Its ancestors up to the row must be static; secondary controls sit above the transparent overlay with relative positioning and z-10. */ .shade-row .shade-row-primary:not(.absolute, .fixed, .sticky) { position: static; } .shade-row:is(.shade-row-interactive, .shade-row-auto) .shade-row-primary:not(:disabled, [aria-disabled='true'])::after { content: ''; display: block; position: absolute; inset: 0 calc(-4 * var(--spacing)); z-index: 1; } .shade-row.shade-row-inset::before, .shade-row-inset .shade-row-primary::after { inset-inline: 0; } .shade-row > [data-row-pinned] { background-color: var(--background); } /* The cell spacing between columns stays intact; only the outside inset is removed, including row headings used in the first column. */ .shade-row > :is(td, th):first-child { padding-inline-start: 0; } .shade-row > :is(td, th):last-child { padding-inline-end: 0; } /* Native table-row generated content becomes an anonymous column with a fixed colgroup, even when absolutely positioned. Paint inside the real cells. */ tr.shade-row::before { content: none; } tr.shade-row > :is(td, th)::before { inset-inline: 0; border-radius: 0; } tr.shade-row > :is(td, th):first-child::before { inset-inline-start: calc(-4 * var(--spacing)); border-start-start-radius: var(--radius-md); border-end-start-radius: var(--radius-md); } tr.shade-row > :is(td, th):last-child::before { inset-inline-end: calc(-4 * var(--spacing)); border-start-end-radius: var(--radius-md); border-end-end-radius: var(--radius-md); } tr.shade-row.shade-row-inset > :is(td, th)::before { inset-inline: 0; } .shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) )::before, tr.shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) ) > :is(td, th)::before { opacity: 1; } .shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) ) > [data-row-pinned] { background-color: var(--table-row-hover); } .shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) ) [data-row-pinned-fade='normal'] { opacity: 0; } .shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) ) [data-row-pinned-fade='highlight'] { opacity: 1; } /* Keep previous-sibling eligibility flat: CSS forbids nesting :has(). Only body separators disappear; outer rules are preserved. */ .shade-row + .shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) ), .shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) ) + .shade-row { border-top-color: transparent; } .shade-row:where( :is([data-state='selected'], [data-selected='true']), :not([data-row-dragging='true'], [data-row-dragging='true'] *):is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):is([data-row-pressed='true'], :active, :focus-visible, :has(:focus-visible)) ):has(+ .shade-row), .shade-row:has(+ .shade-row:is([data-state='selected'], [data-selected='true'])), .shade-row:has( + .shade-row-interactive:not([data-row-dragging='true'], [data-row-dragging='true'] *):is( [data-row-pressed='true'], :active, :focus-visible ) ), .shade-row:has( + .shade-row-interactive:not([data-row-dragging='true'], [data-row-dragging='true'] *) :focus-visible ), .shade-row:has( + .shade-row-auto:not([data-row-dragging='true'], [data-row-dragging='true'] *):is( [data-row-pressed='true'], :active, :focus-visible ) ):has(+ .shade-row-auto .shade-row-primary:not(:disabled, [aria-disabled='true'])), .shade-row:has( + .shade-row-auto:not([data-row-dragging='true'], [data-row-dragging='true'] *) :focus-visible ):has(+ .shade-row-auto .shade-row-primary:not(:disabled, [aria-disabled='true'])) { border-bottom-color: transparent; } /* Avoid emulated, sticky :hover after a touch tap. The press hook covers touch. */ @media (hover: hover) { .shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover )::before, tr.shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover ) > :is(td, th)::before { opacity: 1; } .shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover ) > [data-row-pinned] { background-color: var(--table-row-hover); } .shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover ) [data-row-pinned-fade='normal'] { opacity: 0; } .shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover ) [data-row-pinned-fade='highlight'] { opacity: 1; } /* Only separators shared by body rows disappear; outer rules are preserved. */ .shade-row + .shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover ), .shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover ) + .shade-row { border-top-color: transparent; } .shade-row:where(:not([data-row-dragging='true'], [data-row-dragging='true'] *)):where( :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ):hover ):has(+ .shade-row), .shade-row:has( + .shade-row-interactive:not([data-row-dragging='true'], [data-row-dragging='true'] *):hover ), .shade-row:has( + .shade-row-auto:not([data-row-dragging='true'], [data-row-dragging='true'] *):hover ):has(+ .shade-row-auto .shade-row-primary:not(:disabled, [aria-disabled='true'])) { border-bottom-color: transparent; } } /* Selection wins over hover and keyboard/press fills without merging adjacent rows or changing the focused control's own ring. */ .shade-row:is([data-state='selected'], [data-selected='true'])::before, tr.shade-row:is([data-state='selected'], [data-selected='true']) > :is(td, th)::before, .shade-row:is([data-state='selected'], [data-selected='true']) > [data-row-pinned] { background-color: var(--table-row-selected); } :is( .shade-row-interactive, .shade-row-auto:has(.shade-row-primary:not(:disabled, [aria-disabled='true'])) ) { cursor: pointer; } .shade-row [data-row-secondary] { position: relative; z-index: 10; } /* Explicit positioning utilities take precedence over these control defaults. */ @layer base { .shade-row:is(.shade-row-interactive, .shade-row-auto):has( .shade-row-primary:not(:disabled, [aria-disabled='true']) ) :is(a, button, input, select, textarea, label, [role='checkbox'], [role='button']):not( .shade-row-primary ) { position: relative; z-index: 10; } }