ShtukbaseStandard
страница пакета→ /design/shtukbase-ui-html.md

pages/design/shtukbase-ui-html.md

69 строк, 3.9 КБ. Как страница.

Этот текст ещё не переведён. Ниже английский оригинал.

  1. ---
  2. type: Page
  3. title: "shtukbase-ui-html: the component library"
  4. description: "The Shtukbase components in plain HTML and CSS on the token contract: how a component is written, how controls become attributes, the card presets, what the demo shows."
  5. icon: "🧩"
  6. library: shtukbase-ui-html
  7. css: design/shtukbase-ui-html/ui.css
  8. demo: design/shtukbase-ui-html/demo.html
  9. ---
  10. # shtukbase-ui-html
  11. The look of the package-map mock (29.11.2026) as components in plain HTML and CSS: the shadcn set and our own composites. A [lens layout](/design/conventions/layout.md) places the
  12. generic sidebar, panels and page forms. The CSS reads only the token contract
  13. ([contract](/design/contract.md)), so any style fits: `shtukbase-style` by default, any shadcn theme as well.
  14. Open [demo.html](shtukbase-ui-html/demo.html): the package map rebuilt from the components, then every component in every
  15. state and status and one picture per value of each control.
  16. ## Use it on a page
  17. ```html
  18. <link rel="stylesheet" href="/design/shtukbase-style/tokens.css"> <!-- the style: the contract tokens -->
  19. <link rel="stylesheet" href="/design/shtukbase-ui-html/ui.css"> <!-- the library -->
  20. ```
  21. Copy the markup of a template from the component file; set controls as attributes.
  22. ## A component
  23. `components/<level>/<id>/<id>.html` holds the header (a YAML block in `<!--- … --->`: id, title, level, description, uses,
  24. parts, states, status, controls, cssProperties), then one `<template data-state="…">` per interaction state and one
  25. `<template data-status="…">` per data state. `<id>.css` is next to it. `ui.css` is all of them joined by `build`.
  26. - **Root:** `data-slot="<id>"` and `class="<id>"`; parts are `data-slot="<id>-<part>"` with the same class.
  27. - **Controls:** `select`/`segment` → `data-<control>="<value>"`; `bool` → the attribute present or absent; `range` → the inline
  28. custom property `--<id>-<control>: <value><unit>`; `swatch` → `data-<control>="<token name>"` (e.g. `data-color="--sb-hue-9"`).
  29. An absent attribute is the default.
  30. - **States:** the real `:hover`, `:focus-visible`, `:disabled`, `aria-selected="true"`, `aria-checked`; for a still picture
  31. the same look comes from `data-hover` and `data-focus`. Data states are `data-status="loading|empty|error"`.
  32. - **Accent:** `--ui-accent` (a library variable, set from a token) is the colour of the area or card around; `area` and
  33. `package-card` set it from their `color` control.
  34. ## The owner's decisions it keeps
  35. - Hover changes only the shadow (`--sb-edge` → `--sb-shadow-lift`); no text or card moves.
  36. - Edges and glows are even on every side, never only below; no borders on cards, the edge is a shadow.
  37. - The icon is left of the text, its top on the cap line of the first line (title, or the kicker of the Basic card).
  38. - Chips sit under the text, with a grey outline and radius 6 by default; lifted chips have a tight, light shadow.
  39. - No plate under an icon, coloured, grey or white (SBS-R06); covers take the bright area colour, by default as a hairline that fades to the edges.
  40. - The Basic card: a barely-there tint of the area colour with an edge in that colour (`data-fill="faint"`) and light from
  41. under the card (`data-glow="under"`, strength 4, width 1). The Basic frame is a bar on the left.
  42. ## Card presets
  43. A preset is a bundle; set its layout and size with it (the React library and the explore kit do it for you).
  44. | preset | layout | size | what it changes |
  45. |---|---|---|---|
  46. | base | side | m | nothing: the basis |
  47. | compact | side | s | a larger 52 px icon, two lines of text, chips in one row fading out |
  48. | editorial | side | l | a 19 px title in the display font, roomy |
  49. | cover | top | m | the bare icon, the area colour on the top edge (`cover`: hairline, hairline-right, tick, edge, icon-only) |
  50. | tiles | badge | m | 118 px squares: icon and name |
  51. ## Glow
  52. The glow is drawn under the card by `::before`/`::after` with `z-index: -1`: put cards in a parent with
  53. `isolation: isolate` (`package-grid` and `area` do it).