Appearance

Components take their colours and letters from the page they are placed on: they read the colour behind them, become light or dark with it and mix every other colour from that surface. One attribute adds the application’s accent; variables inherited from a parent override any single colour, including inside the complete catalogue’s nested blocks. The panel below sets a page colour and adjusts the real components; copy the resulting code.

Follow the page, or fix the palette

Without settings, components read the first opaque background behind them, across Shadow DOM boundaries, and become light or dark with it. They read it again when attributes of <html> or <body> change and when the system switches between light and dark; an application that recolours some other wrapper calls readPageColours() from mosaicary/catalog. --mosaicary-surface or the surface attribute names the surface instead of reading it. --mosaicary-color-scheme accepts light, dark or light dark and fixes the palette whatever is behind; the last follows the system preference.

<!-- The page's colours and letters, the application's accent -->
<mosaicary-catalog kinds="skins" accent="#f97316"></mosaicary-catalog>
.fixed-surface {
  --mosaicary-surface: #111217;
}
.always-light {
  --mosaicary-color-scheme: light;
}
.as-the-system {
  --mosaicary-color-scheme: light dark;
}
import { readPageColours } from 'mosaicary/catalog';

// After recolouring a wrapper other than <html> or <body>:
readPageColours();

Override the complete colour palette

The table lists every public colour variable and what it is mixed from when left unset: the surface, and the ink that contrasts with it. --mosaicary-tile-on is derived from accent and tile so selection follows the application’s accent. --mosaicary-good, --mosaicary-caution and --mosaicary-warn distinguish successful conversion, skin cautions and failure states. --mosaicary-backdrop-image can supply a CSS background image. Browsers without light-dark() use the site’s dark colours instead of a partially applied palette.

CSSlight / dark
--mosaicary-accent#176da4 / #4fc3f7
--mosaicary-surfacethe page behind · #eef2f6 / #101318
--mosaicary-canvasunpainted
--mosaicary-panelcolor-mix(surface, ink 3%)
--mosaicary-tilecolor-mix(surface, ink 6%)
--mosaicary-tile-hotcolor-mix(surface, ink 10%)
--mosaicary-tile-oncolor-mix(accent 16%, tile)
--mosaicary-textink: #18202b / #eceff1
--mosaicary-dimcolor-mix(ink 60%, surface)
--mosaicary-edgecolor-mix(surface, ink 14%)
--mosaicary-edge-hovercolor-mix(surface, ink 24%)
--mosaicary-tooltip#ffffff / color-mix(surface, black 35%)
--mosaicary-overlay#00000033 / #00000055
--mosaicary-good#2e7d32 / #81c784
--mosaicary-caution#b26a00 / #ffb74d
--mosaicary-warn#c62828 / #e57373
--mosaicary-backdropcolor-mix(surface, ink 13%)
--mosaicary-backdrop-imagenone

Set typography, layout and viewer dimensions

Typography uses --mosaicary-font-family, --mosaicary-font-size and --mosaicary-line-height. Spacing and corners use --mosaicary-padding, --mosaicary-gap and --mosaicary-radius. Card variables control minimum width, columns and image ratio; fixed column counts require narrow-screen rules. Control height, tag-list height and sidebar width have separate variables. Viewer ratio controls an unconstrained scene; an explicit element height instead reserves space for controls inside that height. These controls affect layout, not resource resolution.

.theme {
  --mosaicary-font-family: system-ui;
  --mosaicary-font-size: 16px;
  --mosaicary-line-height: 1.6;
  --mosaicary-radius: 8px;
  --mosaicary-gap: 12px;
  --mosaicary-padding: 16px;
  --mosaicary-card-min-width: 180px;
  --mosaicary-card-columns: repeat(auto-fill, minmax(180px, 1fr));
  --mosaicary-card-ratio: 1;
  --mosaicary-control-height: 32px;
  --mosaicary-tag-list-height: 16em;
  --mosaicary-sidebar-width: 18em;
  --mosaicary-stage-ratio: 4 / 3;
}
mosaicary-skin {
  height: 360px;
}

Style public parts and selection states

::part addresses a named surface such as card, card-selected, search-input, tag-options, stage or tools. Failure presentation exposes say, say-text and retry. The composed catalogue forwards child parts through exportparts, so its cards can be styled from the outer element. The Component reference lists parts per element, including converter controls. Preserve readable focus, selected and error states, and keep the Mosaicary banner or link visible when adapting the visual design.

mosaicary-catalog::part(card-selected) {
  border-width: 2px;
}
mosaicary-cards::part(say) {
  padding: 1rem;
}
mosaicary-cards::part(retry) {
  font-weight: 600;
}
mosaicary-build-converter::part(drop) {
  padding: 2rem;
}