shtukbasehub

Design lenses

Two lenses for the project's design, on the lens shell: the style specimen (a calm document of every token of the chosen style by group, in the page's theme, its pictures and pages) and the component catalog (the chosen one on the stage; the components by level, its States and its Settings in the right panel; links to the source and the page). They read any style and any library that keep the token contract.

Packagedesign-lensesv0.2.321 files

Design lenses

Two lenses built with the lens kit of the lenses package. They read the installed style and library through the token contract and the component data, so they work for any pair: swap the style in /design/design.md and rebuild.

What it puts in the project:

  • /design/style.html — the style specimen: one document column; colours as rows (a swatch, the name, the value, what it is for), hues as a table of their steps, type as a line in each family, radii, shadows, glows and edges, motion; each value in the page's theme (switch the theme for the other); the style's pictures (/design/<style>/assets/) and its own pages (/design/<style>/*.md). The contents are a section of the right panel.
  • /design/components.html — the component catalog (layout catalog): the stage fills the page, with the chosen component's name once, its description and quiet links (page, HTML, CSS, React, uses, used by); "All components" is a gallery. The right panel has three sections: Components (the tree: "All components", then the levels as folding rows with their components and counts, the chosen level open, built of the library's tree items), States (all side by side, or any one interaction or data state) and Settings (every control of the component; values on its root as data-<control>, a slider as --<id>-<control>; kept in the link). The theme is the page's.
  • /design/design-lenses.md — this description for the project.

Data

  • lib/design/style.data.js (window.SB_STYLE) — written by this package's build from the style named by style: in the header of /design/design.md: its tokens.json and tokens.dark.json (DTCG; a path maps to a name as in design-tokens: sb.hue.1 → --sb-hue-1), else its built tokens.css. check says when it is stale.
  • lib/design/components.data.js (window.SB_COMPONENTS) — written by shtuk run design-components sync.
  • lib/explore.js, lib/explore.css — the panel of the explore-kit package. Without them the catalog uses a small stand-in panel with the same call.

After installing or changing the style: shtuk run lenses build, shtuk run design-components sync, shtuk run design-lenses build. Both lenses open from disk (a double click) and from the live server.

The look of the lenses

The lenses stand on the lens shell (/design/conventions/lens-shell.md of design-components): no top header, settings only in the right panel (ui.settings, else the explore kit's panel, else plain selects), white surfaces, no frame inside a frame, names once. Components are drawn in borderless frames that link only the chosen style's CSS and the resolved lib/design/ui.css, so the lens's own CSS never touches them.

Where the boundary is

  • Here: the two lenses and the build of the specimen's data.
  • The component data, its checks, the Custom Elements Manifest and the stories: design-components.
  • The panel: explore-kit. The style: a style package such as shtukbase-style. The kit and its build: lenses.