Themes are tested on three levels: your own checks with the theme CLI and a local product; certification, the signed result behind a table layout’s Verified badge; and admin approval, which lets an operator run a table layout that has no valid certification record.
Testing your own theme
Before you upload:
npm run theme -- validate <dir>andnpm run theme -- lint-rtl <dir>exit 0.npm run theme -- dev <dir>shows every part, view and section you registered on http://localhost:5180/, and table pages mount your layout there without a record when the table’s style names it, with no[theme]error in the browser console (a theme that throws is deactivated and logs[theme] part site.header of theme "<slug>" threw:).- Upload, preview, activate, customise, roll back, deactivate and delete on a local product, as the tutorial does. A guest window shows what players see.
For a table layout or skin, theme dev mounts your layout on table pages without a record (step 2). On an installed site, a layout without a valid certification record mounts only once an admin with appearance:install enables it on the Themes page (see Certification). Test the layout against the checks in What certification checks at every viewport you support.
What certification checks
Certification runs a table layout on the built client’s table page through a recorded Hold’em cash session, at every viewport of the device matrix (two phones in portrait, one in landscape, a tablet both ways, a laptop and two desktops). For every hero-to-act step of the session (preflop, flop, turn, river) and every viewport it snapshots every data-pe node and checks:
- fit: every visible contract node lies inside the viewport and the page has no horizontal overflow;
- overlap: seats do not overlap each other, the board, the pot or the controls, and the controls do not cover the board or the pot;
- target sizes: every interactive contract node is at least 24 × 24 css px;
- accessibility with axe-core, against the layout’s recorded baseline;
- a clean console: no console error and no uncaught page error;
- contract nodes: the nodes the state requires are present, and nodes the contract marks visible are not hidden;
- values: every contract node shows the adapter’s value, read from the host’s adapter spy after the table rendered, including the raise panel and the chat once opened.
Before it measures a viewport, certification waits until the layout has settled: fonts loaded, and the box of every contract node unchanged for ten animation frames in a row (the seat clock is left out, it moves by design). A layout still moving after ten seconds fails instead of being measured half-settled. The geometry checks judge with fixed tolerances: a node may extend 1 css px past a viewport edge, two nodes may share up to 2 css px on both axes, and a target’s size is rounded to the nearest pixel before it is compared with 24 px. Contract nodes, values, accessibility and the console are judged exactly.
A finding names the check, the node, the step and the viewport, for example [fit] hand 1 flop, hero to act facing a bet @ phone-390x844-portrait: seat-role[seat 1] is 7px past the right edge at 390x844.
The reference is the standard layout, which passes every check at every viewport. A layout under certification fails on any finding.
Certification
A table layout that passes these checks receives a certification record, a signed result shipped in the archive as certification.json (one record, or an array of records, one per layout). Certification is a quality result, not a security control: the upload validator, the SDK-only runtime, the install permission and the server’s action validation are the security. It also covers one recorded Hold’em cash session, so it says nothing yet about other variants or tournaments.
A layout is mountable when its record verifies, when its record verifies apart from the contract version (a product upgrade drops the badge, not the table), or when an admin with appearance:install enabled it on the Themes page. That decision is bound to the installed version and the digest of its files: an upgrade needs a new one, and a rollback returns to the one made for that version. A table whose style names a layout that is not mountable renders standard. An admin previewing a theme may try its declared layouts before deciding.
The server enforces it. At install it stores the record with the theme version (Theme.certification); a rollback or an upgrade without a record clears it. Whenever it builds the theme configuration (GET /api/v1/config/theme) it verifies each declared layout’s record and lists the mountable layouts in mountableLayouts: [{ id, theme, verified }]; the client mounts nothing else. A record certifies layout <id> of theme <slug> when:
- it is a certification record (
formatpoker-engine.certification, version 1) forlayout: { id: "<id>", theme: "<slug>" }, andtheme.jsondeclares that layout (a record for a skin,skinOf, never certifies a layout component); - it was made for these files:
layout.artifactsis a SHA-256 over every file underdist/plus the tokens file (themeArtifactsDigest()insrc/themes/certification.ts), and it must equal the digest of the installed version’s files. A record copied into an archive whose layout code, styles or tokens changed does not certify it; a version bump alone (theme.json) keeps it; summary.okis true andcontractVersionis the server’s contract version;- its signature is an HMAC-SHA256 under the server’s
THEME_CERTIFICATION_KEYwith the key idTHEME_CERTIFICATION_KEY_ID(defaultoperator). An unsigned record never certifies: anyone can compute a plain digest. Without the key on the server no layout is certified.
The admin’s theme detail (GET /api/v1/admin/appearance/themes/:slug) carries layouts: [{ id, certified, reason, message, resultsDigest, acknowledged, mountable }], and the Table Style editor shows the reason under Table layout: no-record, malformed, not-declared, skin-only, wrong-theme, artifacts, failed, contract-version, unsigned, no-key, wrong-key or bad-signature.
The record (format poker-engine.certification, version 1) carries the contract version, the layout id, the fixture with its SHA-256, the steps and viewports, every finding per step and viewport, a summary (ok, counts per check, and a digest over the results that is equal across runs and runners: it covers every finding exactly, except that a geometry finding counts by its check, node, edge or pair, step and viewport without its pixel measurement, which the record keeps for the reader), the runner (Playwright and browser versions, platform, timestamps) and a signature. With THEME_CERTIFICATION_KEY set the signature is an HMAC-SHA256 of the canonical record body (THEME_CERTIFICATION_KEY_ID names the key); without it the record carries a plain SHA-256 digest marked unsigned, which detects edits but does not certify a layout for a live table.
Certification is tied to the contract version. A new contract version requires a new run.
The presentation timers a layout declares are checked against the ranges the adapter allows. Gameplay timers are not the layout’s to change, and timing equivalence on them is measured by certification as a product-side check.
The sample themes
The theme tools from My Account include six sample child themes of default. They are examples, not product themes, and each exercises one capability:
| Sample | What it shows |
|---|---|
sample-tokens | Tokens only: a different accent and felt |
sample-parts | A replaced header, footer and logo part; the tutorial’s subject |
sample-sections | One theme-defined section type and a different front page |
sample-table | A table-only child: different table tokens, a skin of the standard layout, and a complete table layout with a declared timing profile within the ranges; the layout mounts on a live table once an admin enables it or it is certified |
sample-light | A light colour scheme: light tokens plus a stylesheet that maps the shades no token covers, for trying the player’s theme choice |
sample-bad | A tampered archive that references the socket; the validator rejects it |