/* The design system's tokens and its skeletons (./design-system.css has the rest), loaded with the Playground itself (../preview/PendingSheet.tsx) rather than with the preview: the page's first paint shows the same loading page the app shows while its data loads, so a hard refresh goes from loading to loaded as a client-side navigation does. */ .playground-preview { /* type: one step down from the docs, like an app beside its prose */ --ds-text-sm: 0.8125rem; --ds-text-base: 0.9375rem; --ds-text-lg: 1.125rem; --ds-text-xl: 1.375rem; /* a figure (.stats) */ --ds-text-2xl: 1.75rem; --ds-space-1: 0.25rem; --ds-space-2: 0.5rem; --ds-space-3: 0.75rem; --ds-space-4: 1rem; --ds-space-5: 1.5rem; /* a well (a board's column) */ --ds-radius: 12px; --ds-radius-sm: 8px; --ds-radius-xs: 4px; /* the sheet's inset around the app (the frame's) */ --ds-sheet-pad: var(--pg-sheet-pad); /* a row's inset above and below (a row's button reaches into it) */ --ds-row-pad: var(--ds-space-2); /* a button's or a field's inset */ --ds-control-pad-y: 0.375rem; --ds-control-pad-x: 0.875rem; --ds-control-border: 1px; /* The palette is the frame's (--pg-*, ../styles.module.css, switching with the theme there): the panel is the app's surface; a well a step off it holds a board's column or a field's inset */ --ds-text: var(--pg-text); --ds-text-muted: var(--pg-muted); --ds-surface: var(--pg-panel); --ds-surface-2: var(--pg-panel-2); /* a faint line: the busy submit button's trace, and demos that draw their own rule */ --ds-border: var(--pg-line); /* an interactive row's band under the pointer: reads on the panel and on a well alike */ --ds-hover: var(--pg-hover); /* labels and hints: the quietest text that still reads (4.5:1 on the panel and the well) */ --ds-faint: #5f6d83; /* 3:1 on the panel, so field and button edges stay legible */ --ds-border-strong: #78889d; --ds-accent: #1b6fb8; --ds-accent-strong: #155b99; /* the accent's wash: a highlighted row, a changed value, a focus ring, an accent button under the pointer; pressed, it deepens */ --ds-accent-wash: 10%; --ds-accent-press: 18%; --ds-accent-soft: color-mix( in srgb, var(--ds-accent) var(--ds-accent-wash), transparent ); /* a pressed control's (or a chosen segment's) opaque wash */ --ds-accent-pressed: color-mix( in srgb, var(--ds-accent) var(--ds-accent-press), var(--ds-surface) ); --ds-on-accent: #fff; /* a surface raised off a well (a segmented control's pill) */ --ds-raised: var(--ds-surface); --ds-raised-shadow: 0 1px 2px var(--pg-shadow-edge), 0 0 0 1px color-mix(in srgb, var(--ds-text) 6%, transparent); /* Infima's own vars, re-pointed so what reads them (the rt-* fields, links, the error panel's text) follows this palette in both themes */ --ifm-color-emphasis-0: var(--ds-surface); --ifm-color-emphasis-100: var(--ds-surface-2); --ifm-color-emphasis-400: var(--ds-border-strong); --ifm-color-emphasis-500: var(--ds-border-strong); --ifm-color-emphasis-700: var(--ds-text-muted); --ifm-color-content: var(--ds-text); --ifm-font-color-base: var(--ds-text); /* links keep the accent under the pointer */ --ifm-link-color: var(--ds-accent); --ifm-link-hover-color: var(--ds-accent); --ifm-color-formfield-active: var(--ds-accent); /* Infima's headings read these (h1 is set below: theme-classic sizes a first-child h1 as a page title) */ --ifm-h2-font-size: 1.25rem; /* the h2's leading, which the loading page's title holds too */ --ds-h2-leading: 1.3; --ifm-h3-font-size: var(--ds-text-lg); --ifm-h4-font-size: var(--ds-text-base); --ifm-heading-font-weight: 600; --ifm-heading-margin-bottom: var(--ds-space-1); --ifm-paragraph-margin-bottom: var(--ds-space-3); font-size: var(--ds-text-base); line-height: 1.5; color: var(--ds-text); } /* Dark: the same console at night (the panel, well, line and text follow --pg-*); what's left is the design system's own */ html[data-theme='dark'] .playground-preview { /* 4.6:1 on the sheet */ --ds-faint: #78869d; /* 3.4:1 on the sheet, 3.1:1 on a well */ --ds-border-strong: #607189; --ds-accent: #53aef0; --ds-accent-strong: #7cc1f4; --ds-accent-wash: 14%; --ds-on-accent: #04121f; /* a step up from the well, with no shadow to cast */ --ds-raised: color-mix(in srgb, var(--ds-text) 14%, var(--ds-surface-2)); --ds-raised-shadow: none; /* fields sit in the well, a step above the panel */ --ifm-color-emphasis-0: var(--ds-surface-2); } /* Skeletons: what is loading, drawn where it will land in the shape it will take, so nothing moves when it arrives. A `skeleton` is one line of text: beside a row's label it holds the value's place (a clock's "API time"), in a table cell a number's. (./Loading.tsx) draws a page of them: a title and a paragraph. The zero-width space gives it a real line, so it keeps the row's height and baseline; the bar is a rounded band in that line, with a soft light sweeping across (still for reduced motion). */ .playground-preview .skeleton { position: relative; display: inline-block; width: 8em; max-width: 100%; } .playground-preview .skeleton::before { content: '\200b'; } .playground-preview .skeleton::after { content: ''; position: absolute; inset: 0; height: 0.7em; margin-block: auto; border-radius: var(--ds-radius-xs); background: linear-gradient( 100deg, transparent 35%, var(--ds-hover) 50%, transparent 65% ) var(--ds-hover); background-size: 300% 100%; animation: ds-shimmer 1.6s ease-in-out infinite; } @keyframes ds-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } } @media (prefers-reduced-motion: reduce) { .playground-preview .skeleton::after { animation: none; } } .playground-preview td > .skeleton { width: 3.5em; } /* a figure's (.stats): at a figure's size the 8em line would fill its whole column; a price is about 5em */ .playground-preview .stats dd > .skeleton { width: 5em; } /* a page: its title at the h2's size, then the paragraph's lines, the last one short like a paragraph's. The side-by-side playground's loading sheet is fixed at --pg-pending-sheet (../styles.module.css) to fit it */ .playground-preview .skeletonPage > .skeleton { display: block; width: 100%; } .playground-preview .skeletonPage > .skeleton:first-child { width: 55%; margin-bottom: var(--ds-space-3); font-size: var(--ifm-h2-font-size); line-height: var(--ds-h2-leading); } .playground-preview .skeletonPage > .skeleton:last-child { width: 62%; }