Skip to content

Theming and customizing ​

The panel ships with a neutral skin called Graphite: zinc grays, a near-black accent, light and dark. Change it from the outside, from lightest touch to heaviest.

Tokens ​

Every color, radius and font is a CSS custom property:

css
sigport-signin,
sigport-button {
  --sigport-accent: #2563eb;
  --sigport-accent-ink: #ffffff;
  --sigport-radius: 16px;
  --sigport-font: 'Geist', system-ui, sans-serif;
}
TokenUsed for
--sigport-accent, --sigport-accent-inkTop-row border, primary buttons, focus ring; text on them
--sigport-raised, --sigport-bg, --sigport-sunkenCard, rows and inputs, tiles
--sigport-ink, --sigport-mutedText
--sigport-line, --sigport-line-strongBorders
--sigport-top-bgThe suggested row's fill
--sigport-dangerErrors
--sigport-radius, --sigport-widthCorner radius, panel width
--sigport-font, --sigport-mono, --sigport-easeType and motion

Light and dark ​

theme="auto" (the default) follows the system. theme="light" and theme="dark" force one. To restyle dark mode, set the tokens under [theme='dark'].

Fitting into your own card ​

  • bare drops the card's background, border and radius, so the panel sits inside your modal.
  • hide-footer removes "Secured by sigport".

Parts ​

For anything the tokens don't reach:

css
sigport-signin::part(title) { font-family: 'Fraunces', serif; }
sigport-signin::part(row) { min-height: 56px; }

The parts are card, header, title, lede, row, tile, side, button, field, input, qr and error. <sigport-button> also has dialog.

Words ​

js
panel.strings = { title: 'Log in to Acme', lede: 'Pick whatever you already use.' };

Every key is in DEFAULT_STRINGS from @sigport/elements. Error sentences come from createSigport({ messages }). See Errors.

Labels, notes and app lists ​

Adapters carry their own words and catalogs. Pass options, or spread and override:

ts
import { EXTENSIONS, extension } from '@sigport/core/adapters/extension';
import { passkey } from '@sigport/core/adapters/passkey';

createSigport({
  adapters: [
    extension({ catalog: [...EXTENSIONS, { id: 'mine', name: 'My Signer', platforms: 'Chrome', href: 'https://example.com', link: 'download' }] }),
    { ...passkey(), label: 'Face ID or fingerprint' },
  ],
});

Subclassing ​

SigportSignIn is a Lit element. Import it from @sigport/elements, which registers nothing, then extend it:

ts
import { SigportSignIn } from '@sigport/elements';
import { css } from 'lit';

class AcmeSignIn extends SigportSignIn {
  static override styles = [SigportSignIn.styles, css`.label { display: none; }`];
}
customElements.define('acme-signin', AcmeSignIn);

If you need different markup altogether, build your own UI on the headless core.

MIT licensed.