ShtukbaseStandard
页面/design/kit-style.md

这段内容尚未翻译,下面是英文原文。

The lens kit style

The Shtukbase lens style for any HTML pages of a project: classes lx-… and kx-…, three skins (Kit, Draft and Shtukbase), light and dark themes.

页面字段(1)
icon🖌️

The style in which Shtukbase lenses are drawn, for any HTML page of a project. The classes are in kit.css; the values of colors, shadows and fonts are in the skins: Kit and Draft and Shtukbase. No build. Examples are in the showcase.

How to connect it

<link rel="stylesheet" href="design/kit-style/skins/kit.css">   <!-- the path from your page; Kit is always needed -->
<link rel="stylesheet" href="design/kit-style/kit.css">
<link rel="stylesheet" href="design/kit-style/skins/keer.css">  <!-- if you need Draft -->
<link rel="stylesheet" href="design/kit-style/skins/shtukbase.css">  <!-- if you need Shtukbase -->
<main class="kx-page"><div class="lx-md">…text…</div></main>
  • The Draft style is data-skin="keer" on <html>, the Shtukbase style data-skin="shtukbase"; without the attribute it is Kit.
  • The dark theme is data-theme="dark" on <html>.

Lenses connect everything themselves: the lenses package builds lib/kit.css from these files, and the choice of style is in the lens header.

Choosing the style on a page

A page that is not a lens links page.js in <head> after the CSS (no defer). It sets data-skin and data-theme on <html> from the choice shared with the lenses (lx-skin, lx-theme in localStorage); without a choice it uses the skin named on <html data-skin="...">, otherwise calm. It draws a small switch in the corner (or into <div data-kx-switch>) that offers the skins the page links; a page in a frame has none and follows its host. The rule REPO-PAGES-WEAR-THE-KIT (shtuks/norms/rules/pages-wear-the-kit.md) asks every page to connect it this way.

Skins

A skin sets variables: surfaces --bg, --bg2, --bg3, --panel, --lx-card, --tray, --canvas; text --ink, --lx-muted, --faint; lines --line, --line2; hover --wash, --wash2; accent --lx-accent, --accent-soft; shadows --shadow, --shadow-lift, --shadow-peek; corner radii --lx-radius, --radius-lg; fonts --font, --mono; canvas dots and grid --canvas-dot, --canvas-grid; selection --selection; ten option colors --c-*, --cb-*, --cf-*, --ct-*.

SkinidWhere from
Calmcalmthe look of the package map in the explore kit: warm grey surfaces and lines, colour only as an accent, grey outlined chips, no tinted areas; the default for pages; written by hand
Desktopdesktopthe Shtukbase desktop app (engine/gui): its light and dark grounds, text tones, borders, blue accent and the select option palette (tinted chips, no dot; board columns faintly tinted by their hue); the default of the layouts (layout-basic, layout-studio) and their lenses; written by hand from the app's theme
Kitkitthe quiet Shtukbase style, the Notion palette; written by hand
Draftkeeran earlier product's style "Draft, graphite, champagne"; built by a script from the keer-style tokens, do not edit by hand
Shtukbaseshtukbasethe chosen style of the project: every variable reads a name of the token contract (--background, --foreground, --border, --ring, --shadow-sm, --font-sans, --sb-hue-* …), so a page that links /design/<style>/tokens.css wears that style; without it the names fall back to the Shtukbase look (white document, even soft shadows, compact controls); written by hand

Four kit names would clash with contract names of another meaning, so since 0.3 they carry the prefix --lx-: --lx-card, --lx-accent, --lx-muted, --lx-radius. A component library on a lens page reads --card, --accent, --muted and --radius of the chosen style unchanged; that is what lets the lens kit draw its frame with the library's shell (see /design/conventions/lens-shell.md). A page of a project that read the old names for the kit's values must read the --lx- names.

The Draft skin is rebuilt by the package's scripts/skin-keer.ts (in a project, the skin-keer action). The keer-style tokens have no color of their own for the teal option (teal), so it is taken from Kit. The Geist font comes first in the style; if it is not in the system, the system font is used.

What there is

WhatClasses
Page columnkx-page (720 px), kx-page wide (1120 px), kx-section, kx-row, kx-grid
Headerlx-top, lx-crumbs, lx-crumb, lx-tools, lx-btn (on, icon)
Chipslx-chip, lx-chip dot; color is style="--cb: var(--cb-green); --cf: var(--cf-green)" or --cc for a dot
Links to recordslx-ref (missing), lx-kbd
Cardlx-card (compact), inside hd, ttl, sub, mono, chips, cnt
Textlx-md: headings, lists, code, quotes, tables, callout, cols
Board and gallerylx-board, lx-col (ch, n, cd), lx-gallery, lx-empty

Where from and where to

The style lives in one place, here. Before version 0.2 it was a copy of part of the kit.css of the lenses package; now lenses takes it from here.

包 The lens kit style 会把此页面放在 /design/kit-style.md。源文本