Mixins / foldkit-mixins-ui

Icons

namespace · packages/mixins-ui/src/icons.ts:7

export * as Icons from './icons.js'

Attribute-dispatched mask icons: mechanisms, not components. An element shows the icon its attribute names, drawn from --icon over the text's color. Where an icon comes from (a data URI, a file) is the application's: pass resolved url(…) strings. No slots, no views.

In the guides

Members

Icons.byAttribute

function · packages/mixins-ui/src/icons.ts:25

function byAttribute(
  attribute: string,
  icons: Readonly<Record<string, string>>,
): StyleValue

Sets --icon by an attribute's value: each value its own icon.

Icons.glyph

function · packages/mixins-ui/src/icons.ts:13

function glyph(size: string): StyleValue

Draws the icon in --icon before the element's words, in their color.

Icons.tokens

function · packages/mixins-ui/src/icons.ts:41

function tokens(
  pack: {
    readonly [Name in ChromeIcon]: IconData
  },
  stroke?: Stroke,
): {
  readonly icon: {
    readonly [Name in ChromeIcon]: string
  }
}

A pack of the icons the components draw themselves, as tokens to pass with an application's own (AppStyle.make({ theme, tokens: Icons.tokens(pack) })): each icon's mask, its strokes redrawn first when stroke asks. A pack missing one the components draw is a type error.