shtukbasehub

Base of the design checks

The shared library of the design-* and shadcn packages: which project files to look at, CSS parsing, colors and contrast by WCAG, HTML and TSX markup. It has no norms of its own.

Packagedesign-basev0.1.07 files

Base of the design checks

The library the checks of the design-a11y, design-scales, design-tokens and shadcn packages stand on. The package has no norms or actions of its own. A separate package is needed so that the same CSS and color parsing does not live in four copies.

What is inside (lib/, in TypeScript, no npm dependencies):

  • files.ts: which project files the checks look at, and the output of findings;
  • css.ts: CSS blocks, declarations with lines, themes from CSS variables, var() substitution;
  • color.ts: a color from CSS text (hex, rgb, hsl, oklch, oklab), luminance and contrast by the WCAG 2.2 formula;
  • markup.ts: HTML and JSX elements: attributes, inner text, lines with classes.

The page Which files the design checks look at sets where to look: the scan folders, the ignore exceptions, the packageFiles flag.

Boundary: the package checks nothing itself. The norms are in the packages that require it.