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:
sigport-signin,
sigport-button {
--sigport-accent: #2563eb;
--sigport-accent-ink: #ffffff;
--sigport-radius: 16px;
--sigport-font: 'Geist', system-ui, sans-serif;
}| Token | Used for |
|---|---|
--sigport-accent, --sigport-accent-ink | Top-row border, primary buttons, focus ring; text on them |
--sigport-raised, --sigport-bg, --sigport-sunken | Card, rows and inputs, tiles |
--sigport-ink, --sigport-muted | Text |
--sigport-line, --sigport-line-strong | Borders |
--sigport-top-bg | The suggested row's fill |
--sigport-danger | Errors |
--sigport-radius, --sigport-width | Corner radius, panel width |
--sigport-font, --sigport-mono, --sigport-ease | Type 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
baredrops the card's background, border and radius, so the panel sits inside your modal.hide-footerremoves "Secured by sigport".
Parts
For anything the tokens don't reach:
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
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:
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:
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.