Skip to content

components/tone

import { … } from 'zidane-ui'ui/src/components/tone.ts

Functions#

badgeColorStyleFunction#

An exact icon color (#rgb / #rrggbb) as an inline style over the tone class; nothing for anything else.

TypeScript
function badgeColorStyle(color: unknown): CSSProperties | undefined
Parameters
NameTypeDescription
colorunknown

The color an extension named.

CSSProperties | undefined

ui/src/components/tone.ts:80

toneFillClassFunction#

The fill class of a tone, for a bar or a dot. No tone, or one the kit doesn't know, is muted.

TypeScript
function toneFillClass(tone: Tone | ToneAlias | undefined): string
Parameters
NameTypeDescription
toneTone | ToneAlias | undefined

A tone or an alias.

string

ui/src/components/tone.ts:68

toneTextClassFunction#

The text color class of a tone. No tone, or one the kit doesn't know, is muted.

TypeScript
function toneTextClass(tone: Tone | ToneAlias | undefined): string
Parameters
NameTypeDescription
toneTone | ToneAlias | undefined

A tone or an alias (an extension badge's warn).

string

ui/src/components/tone.ts:59

Types#

ToneType#

What a color says: body text, quiet text (muted, subtle), the accent, or a status.

TypeScript
type Tone =
  | 'text'
  | 'muted'
  | 'subtle'
  | 'accent'
  | 'info'
  | 'success'
  | 'warning'
  | 'danger'

ui/src/components/tone.ts:14

ToneAliasType#

The other names a tone goes by: core's warn (extension and composer badges), error and a view's default.

TypeScript
type ToneAlias = 'warn' | 'error' | 'default'

ui/src/components/tone.ts:17