LiminaliaLiminalia
Technical docs: Changing the look of the built-in screens

Changing the look of the built-in screens

Open in Claude (new tab)

Every built-in screen (title, message window, choices, save, ending name, and so on) can change its look in the four tiers below. If an upper tier is enough, you do not need the lower ones.

  1. Text: replace the fixed wording on a screen with the game’s text table. The keys are the nested paths of TEXT in packages/screens/src/strings.ts (such as "ending.mark"). Write them in a plugin’s texts or in the ui of a translation file (lang/<language>.json) (see “Changing the wording of the built-in screens” in plugins.md and the multilingual part of chapter 10 in format.md)
  2. Theme values: values in the ui of liminalia.json and of a theme’s themes/<id>/theme.json (the shape is UiConfig in @liminalia/lang; see “Game settings” and “Themes” in player.md). Choosing a theme swaps these values together
  3. CSS: override the classes and the CSS variables such as --lm-* in the game’s CSS. The engine’s CSS sits in the cascade layer liminalia, so the game’s CSS wins without fighting over selector specificity. List the game’s CSS in ui.css in liminalia.json (it’s loaded after the theme and plugin CSS; “Project CSS” in player.md). In Liminalia Studio’s “Game screens”, you can click a part and write lines one at a time from fields
  4. Your own screen: pass a function that builds an element to a plugin’s screens.* and so on, and build the whole screen yourself (see “Replacing only the look of the standard screens” in plugins.md). The system handles opening, closing, blocking input and telling the recorder what can be chosen; the function drives the screen by calling the api it receives

The table lists what each screen can change in the four tiers. ”—” means the screen does not have that tier; the reasons follow the table. The table is generated from packages/web/src/system/screen-catalog.ts (npx tsx packages/web/scripts/screen-catalog.ts), and a test checks it against the source (adding a screen, a text group, a theme value group or a replacement hook without listing it fails the test). The parts table after it maps each screen’s parts (selectors) to the theme values and CSS variables that set their look; it is what the panel shows when you click a part in the preview on the “Game screens” screen of Liminalia Studio (see studio.md). The tests check that each value is in ui in liminalia.json, that ui-style.ts puts the value into the listed variable, that the CSS of the part or its screen reads the variable, and that the parts appear on the sample screens. The same list and parts tables can also be read with lim shot --screens --json and the MCP tool list_screens. lim shot --screen <screen> (the MCP tool screen_shot) opens a screen in the same sample with sample content and captures it (see “Changing a built-in screen and checking it” in mcp.md).

Screen1 Text keys2 Theme values (ui)3 CSS classes and variables4 Replacement hook
Click to startgate, gateTouch—.lm-gate—
Opening sequence—splash.lm-splash, .lm-splash-screen, .lm-splash-logo-image, .lm-splash-block, .lm-splash-label, .lm-splash-text, .lm-splash-rulesplash, endSplash
Content warningwarning.*contentWarning, system.lm-warning, .lm-warning-panel, .lm-warning-text, .lm-warning-buttons, shared variables—
Titletitle.*title.menu, title.background, title.logo, title.showName, system.titleBg, system.titleButtonBg, system.titleShadow.lm-title, .lm-title-name, .lm-title-logo, .lm-title-menu, .lm-title-button, --lm-title-bg, --lm-title-button-bg, --lm-title-shadow, --lm-title-align, --lm-title-direction, --lm-title-gap, --lm-title-button-width, shared variablestitle, system
Message window and text—message, text, fonts, face.message, .text, .ch, .message-frame, --message-bg, --message-fg, --message-border, --message-radius, --message-image, --message-padding, --font, --text-size, --text-line, --text-shadow, --read-fg, --lm-reveal-animation, --lm-reveal-time, --lm-reveal-easingextensions.text, extensions.dialogue
Name box—name.name, .lm-name-custom, --name-fg, --name-bg, --name-size, --name-border, --name-image, --name-font, --name-padding, --name-rulescreens.name
Click-wait icon—glyph.glyph, .glyph-shape, --glyph-fg, --glyph-size, --glyph-gapextensions.text.glyph
Choiceschoice.*choice.choices, .choice-image, .choice-area, .choice-timer, .is-locked, .is-read, .lm-choices-custom, --choice-width, --choice-size, --choice-gap, --choice-fg, --choice-bg, --choice-hover-bg, --choice-border, --choice-image, --choice-radius, --choice-fontscreens.choice
Quick menumenu.*menuBar.lm-menubar, --lm-bar-fg, --lm-bar-shadow, --lm-bar-image, --lm-bar-active-imagescreens.menuBar
Auto and skip indicatormenu.auto, menu.skipindicator, menuBar.color, menuBar.shadow.lm-indicator, .lm-indicator-mark, .lm-indicator-at-top-left, shared variablesscreens.indicator
Menumenu.*system.lm-menu, .lm-menu-panel, .lm-menu-list, shared variablesscreens.menu
Save and loadsaveload.*, saves.*system, saveSlots, chapterNames.lm-saveload, .lm-slots, .lm-slot-thumb, .lm-slot-name, .lm-slot-text, .lm-slot-date, .lm-slot-tools, --lm-thumb-bg, shared variablesscreens.saveload
Settingsconfig.*, saves.*system, system.images.sliderThumb, defaults, settings, message.background.lm-config, .lm-config-row, .lm-config-label, .lm-config-control, .lm-config-value, .lm-preview, --lm-slider-thumb, shared variablesscreens.config
Backlogbacklog.*system, backlog, backlogChoices.lm-backlog, .lm-log, .lm-log-name, .lm-log-text, .lm-log-search, --lm-speaker-fg, --lm-speaker-font, shared variablesscreens.backlog
Confirmationconfirm.*, analytics.*, crash.*, update.*, quitUnavailablesystem, system.images.frame.lm-dialog-backdrop, .lm-dialog, .lm-dialog-message, .lm-dialog-buttons, --lm-frame-bg, --lm-frame-border, --lm-backdrop, shared variablesscreens.confirm
Ending nameending.*ending, system.titleBg, system.fg, system.accent.lm-ending, .lm-ending-go, .lm-ending-kind, .lm-ending-name, .lm-ending-rule, .lm-ending-mark, .lm-ending-mark-above, .lm-ending-mark-none, --lm-ending-bg, --lm-ending-image, --lm-ending-font, --lm-ending-fg, --lm-ending-size, --lm-ending-letter-spacing, --lm-ending-kind-fg, --lm-ending-rule, --lm-ending-mark-fg, --lm-ending-mark-sizescreens.ending
Extrasextra.*system.lm-extra, .lm-extra-grid, .lm-extra-thumb, .lm-extra-viewer, .lm-extra-list, .lm-music, shared variablesscreens.extra
Flowchartflowchart.*system.lm-flow, .lm-flow-canvas, .lm-flow-summary, .lm-flow-ending, shared variablesscreens.flowchart
Controls helphelp.*system, help.lm-help, .lm-help-body, .lm-help-table, .lm-help-page, shared variablesscreens.help
Inventoryitems.*system.lm-items, .lm-items-grid, .lm-items-detail, shared variablesscreens.items
Dialog and text input (@dialog, @text-input)dialog.*system.border, system.controlBg, system.fg, message.background, text.color, text.font.lm-panel, .lm-panel-box, .lm-panel-buttons, .lm-panel-custom, .lm-keyboard, --lm-dialog-border, --lm-dialog-button-bg, --lm-dialog-button-fgscreens.dialog
Notifications (@notify)—system.screenBg, system.fg, system.accent, text.font.lm-notices, .lm-notice, .lm-notice-title, --lm-notice-bg, --lm-notice-fg, --lm-notice-accent, --lm-notice-top, --lm-notice-right, --lm-notice-gap, --lm-notice-widthscreens.toast
Short messages (Saved, etc.)toast.*, store.*system.screenBg, system.fg, system.border, system.radius.lm-toast, --lm-toast-bg—
Glossary popupextra.termAddedsystem.lm-term-pop, .lm-term-name, .lm-term-desc, .lm-term, shared variables—
Sound captionscaptions.*captions.lm-caption—
Rotate-device hintrotate, rotateKeep—.lm-rotate—
Playtest feedbackfeedback.*—.lm-feedback—
Codex (@codex)codex.*system.lm-codex, .lm-codex-list, .lm-codex-item, .lm-codex-detail, .lm-codex-fresh, .lm-codex-related, shared variablesscreens.codex
Investigation (@investigate)investigate.*system.lm-investigate, .lm-investigate-spot, .lm-investigate-tip, .lm-investigate-finish, .lm-investigate-reveal, .lm-investigate-progress, .lm-investigate-opening, shared variablesextensions.renderers.investigate
Map choice (@map-choice)mapChoice.*system.lm-map-choice, .lm-map-choice-spot, .lm-map-choice-panel, .lm-map-choice-locked, .lm-map-choice-go, shared variablesextensions.renderers.map-choice
Chapter card and chapter end (@chapter-card, @chapter-end)chapter.*chapter, system.titleBg, system.fg, system.accent.lim-chapter, .lim-chapter-number, .lim-chapter-title, .lim-chapter-rule, .lim-chapter-subtitle, .lim-chapter-end, .lm-chapter-no-rule, --lim-chapter-bg, --lim-chapter-image, --lim-chapter-font, --lim-chapter-fg, --lim-chapter-size, --lim-chapter-letter-spacing, --lim-chapter-accent, --lim-chapter-number-size, --lim-chapter-subtitle-fg, --lim-chapter-subtitle-size, --lim-chapter-rule, --lim-chapter-end-fg, --lim-chapter-end-sizeextensions.renderers.chapter-card, extensions.renderers.chapter-end
Cut-in (@cutin)——.lim-cutin-frame, .lim-cutin-imageextensions.renderers.cutin
HUD (@hud)—message.background, message.borderColor, text.color, text.shadow, text.size, text.font.lim-hud, .lim-hud-button, .lim-hud-text, --message-bg, --message-fg, --message-border, --text-shadowextensions.renderers.hud
Chat screen (@chat-open, ui.chat.dialogue)—chat.lim-chat, .lim-chat-head, .lim-chat-list, .lim-chat-row, .lim-chat-bubble, .lim-chat-name, .lim-chat-note, --chat-bg, --chat-fg, --chat-other-bg, --chat-me-bg, --chat-radius, --chat-fontextensions.dialogue

Shared variables (filled from ui.system and read by every system screen):

--lm-fg, --lm-fg-muted, --lm-accent, --lm-ui-font, --lm-text-font, --lm-screen-bg, --lm-control-bg, --lm-control-hover, --lm-control-active, --lm-border, --lm-border-faint, --lm-radius, --lm-screen-image, --lm-button-image, --lm-frame-image

Text keys shared by every screen:

  • close: Close buttons (every screen)
  • a11y: Text handed to screen readers and text-to-speech

Tiers a screen does not have, and why:

  • Click to start, theme values: A black layer that takes the first press so sound can play; it shows before the game’s values are read
  • Click to start, replacement: Not replaceable for the same reason; replace the opening sequence with splash
  • Opening sequence, text: All text is written by the game in ui.splash
  • Content warning, replacement: Not replaceable because it collects consent; change the text with ui.contentWarning
  • Message window and text, text: The text comes from the script; the window has no fixed wording
  • Name box, text: Names come from the script and cast.json
  • Click-wait icon, text: A text icon is set with ui.glyph.text
  • Notifications (@notify), text: The text comes from @notify and the game
  • Short messages (Saved, etc.), replacement: A one-line message; the text table and CSS cover it. Use @notify and screens.toast for the game’s own messages
  • Glossary popup, replacement: A small popup on a word; CSS covers it. The glossary list is part of the extras (screens.extra)
  • Sound captions, replacement: An accessibility aid that stays white on dark (CSS can still change it)
  • Rotate-device hint, theme values: A device hint that does not follow the game’s look
  • Rotate-device hint, replacement: Not replaceable for the same reason
  • Playtest feedback, theme values: A development tool shown only in playtest builds made with lim build —feedback
  • Playtest feedback, replacement: Not replaceable for the same reason
  • Cut-in (@cutin), text: An image-only effect with no wording
  • Cut-in (@cutin), theme values: Its look comes from the image and the command’s parameters
  • HUD (@hud), text: The game writes the text and images in @hud
  • Chat screen (@chat-open, ui.chat.dialogue), text: The text comes from the script and ui.chat.title

Screen parts and the theme values that set their look (the CSS variable each value goes into is in parentheses; a dash marks a part with no theme value, styled by overriding its selector in the game’s CSS):

ScreenPartSelectorTheme values (ui)
Click to startClick-to-start layer.lm-gate—
Opening sequenceLogo.lm-splash-logo-imagesplash.logos
Splash screen.lm-splash-screensplash.notice.background, splash.notice.color
Content warningWarning text.lm-warning-textcontentWarning.text, system.fg (--lm-fg), system.font (--lm-ui-font)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
TitleGame title.lm-title-namesystem.titleShadow (--lm-title-shadow), system.fg (--lm-fg)
Logo.lm-title-logotitle.logo
Title buttons.lm-title-buttonsystem.titleButtonBg (--lm-title-button-bg), system.border (--lm-border), system.radius (--lm-radius), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Button layout.lm-title-menutitle.menu
Title background.lm-titletitle.background, system.titleBg (--lm-title-bg)
Message window and textText.texttext.font (--font), text.size (--text-size), text.color (--message-fg), text.lineHeight (--text-line), text.letterSpacing (--text-letter-spacing), text.shadow (--text-shadow), text.readColor (--read-fg)
Message window.messagemessage.background (--message-bg), message.borderColor (--message-border), message.radius (--message-radius), message.padding (--message-padding), message.image (--message-image)
Name boxName box.namename.color (--name-fg), name.size (--name-size), name.font (--name-font), name.background (--name-bg), name.borderColor (--name-border), name.letterSpacing (--name-letter-spacing), name.shadow (--name-shadow), name.image (--name-image), name.rule (--name-rule)
Click-wait iconClick-wait icon.glyphglyph.color (--glyph-fg), glyph.size (--glyph-size), glyph.gap (--glyph-gap), glyph.shape, glyph.text, glyph.image, glyph.motion
ChoicesChoice buttons.choices > buttonchoice.font (--choice-font), choice.size (--choice-size), choice.color (--choice-fg), choice.background (--choice-bg), choice.borderColor (--choice-border), choice.radius (--choice-radius), choice.letterSpacing (--choice-letter-spacing), choice.shadow (--choice-shadow), choice.image (--choice-image)
Choice list.choiceschoice.width (--choice-width), choice.gap (--choice-gap), choice.y (--choice-y)
Quick menuQuick menu.lm-menubarmenuBar.color (--lm-bar-fg), menuBar.shadow (--lm-bar-shadow)
Auto and skip indicatorAuto and skip indicator.lm-indicatormenuBar.color (--lm-bar-fg), menuBar.shadow (--lm-bar-shadow)
MenuHeading.lm-screen-titlesystem.fg (--lm-fg)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Menu panel.lm-menu-panelsystem.screenBg (--lm-screen-bg), system.images.frame (--lm-frame-image), system.border (--lm-border), system.radius (--lm-radius), system.fg (--lm-fg), system.font (--lm-ui-font)
Backdrop.lm-menu—
Save and loadSlot number.lm-slot-namesystem.accent (--lm-accent)
Date.lm-slot-datesystem.fg (--lm-fg-muted)
Chapter name.lm-slot-chapterchapterNames, system.fg (--lm-fg-muted)
Text.lm-slot-textsystem.fg (--lm-fg-muted)
Memo.lm-slot-memosystem.accent (--lm-accent)
Memo and lock buttons.lm-slot-toolsystem.controlBg (--lm-control-bg), system.border (--lm-border-faint), system.radius (--lm-radius), system.fg (--lm-fg-muted)
Thumbnail.lm-slot-thumbsystem.border (--lm-border-faint)
Save slot.lm-slotsystem.controlBg (--lm-control-bg), system.border (--lm-border-faint), system.radius (--lm-radius), system.accent (--lm-accent)
Slot grid.lm-slotssaveSlots
Heading.lm-screen-titlesystem.fg (--lm-fg)
Tabs.lm-tabsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
SettingsItem name.lm-config-labelsystem.fg (--lm-fg)
Value.lm-config-valuesystem.fg (--lm-fg-muted)
Slider.lm-rangesystem.images.sliderThumb (--lm-slider-thumb), system.accent (--lm-accent)
Text preview.lm-previewmessage.background (--message-bg), system.border (--lm-border)
Toggle buttons.lm-togglesystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image)
Heading.lm-screen-titlesystem.fg (--lm-fg)
Tabs.lm-tabsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
BacklogSpeaker.lm-log-namesystem.accent (--lm-accent)
Text.lm-log-textsystem.fg (--lm-fg)
Search box.lm-log-searchsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.fg (--lm-fg), system.font (--lm-ui-font)
Heading.lm-screen-titlesystem.fg (--lm-fg)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
ConfirmationMessage.lm-dialog-messagesystem.fg (--lm-fg)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Dialog.lm-dialogsystem.screenBg (--lm-screen-bg), system.images.frame (--lm-frame-image), system.border (--lm-border), system.radius (--lm-radius), system.font (--lm-ui-font)
Backdrop.lm-dialog-backdrop—
Ending nameKind.lm-ending-kindending.kindColor (--lm-ending-kind-fg), system.accent (--lm-accent)
Ending name.lm-ending-nameending.font (--lm-ending-font), ending.color (--lm-ending-fg), ending.size (--lm-ending-size), ending.letterSpacing (--lm-ending-letter-spacing)
Divider.lm-ending-ruleending.rule (--lm-ending-rule), system.accent (--lm-accent)
End mark.lm-ending-markending.mark, ending.markColor (--lm-ending-mark-fg), ending.markSize (--lm-ending-mark-size)
Background.lm-endingending.background (--lm-ending-bg), ending.image (--lm-ending-image), system.titleBg (--lm-title-bg)
ExtrasCG thumbnail.lm-extra-thumbsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius)
Heading.lm-screen-titlesystem.fg (--lm-fg)
Tabs.lm-tabsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
FlowchartProgress.lm-flow-summarysystem.fg (--lm-fg-muted), system.font (--lm-ui-font)
Heading.lm-screen-titlesystem.fg (--lm-fg)
Tabs.lm-tabsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
Controls helpControls table.lm-help-tablesystem.border (--lm-border-faint), system.fg (--lm-fg-muted)
Heading.lm-screen-titlesystem.fg (--lm-fg)
Tabs.lm-tabsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
InventoryItem.lm-items-tilesystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent)
Name.lm-items-namesystem.fg (--lm-fg)
Description.lm-items-descsystem.fg (--lm-fg)
Picture.lm-items-picture—
Heading.lm-screen-titlesystem.fg (--lm-fg)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-screensystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg), system.font (--lm-ui-font)
Dialog and text input (@dialog, @text-input)Buttons.lm-panel-buttonssystem.controlBg (--lm-dialog-button-bg), system.fg (--lm-dialog-button-fg), system.border (--lm-dialog-border)
Dialog.lm-panel-boxmessage.background (--message-bg), system.border (--lm-dialog-border), text.font (--font), text.color (--message-fg)
Notifications (@notify)Notification.lm-noticesystem.screenBg (--lm-notice-bg), system.fg (--lm-notice-fg), system.accent (--lm-notice-theme-accent), text.font (--font)
Short messages (Saved, etc.)Short message.lm-toastsystem.screenBg (--lm-toast-bg), system.border (--lm-border), system.radius (--lm-radius), system.fg (--lm-fg)
Glossary popupTerm.lm-term-namesystem.accent (--lm-accent)
Glossary popup.lm-term-popsystem.screenBg (--lm-screen-bg), system.fg (--lm-fg), system.border (--lm-border), system.radius (--lm-radius), system.font (--lm-ui-font)
Term in the text.lm-term—
Sound captionsCaption.lm-caption—
Rotate-device hintRotate-device hint.lm-rotate—
Playtest feedbackFeedback form.lm-feedback—
Codex (@codex)New badge.lm-codex-freshsystem.accent (--lm-accent), system.radius (--lm-radius), system.screenBg (--lm-screen-bg)
Person on the chart.lm-codex-nodesystem.radius (--lm-radius), system.accent (--lm-accent), system.border (--lm-border), system.screenBg (--lm-screen-bg)
List.lm-codex-listsystem.border (--lm-border)
Heading.lm-screen-titlesystem.fg (--lm-fg)
Buttons.lm-buttonsystem.controlBg (--lm-control-bg), system.border (--lm-border), system.radius (--lm-radius), system.accent (--lm-accent), system.images.button (--lm-button-image), system.font (--lm-ui-font)
Screen background.lm-codexsystem.screenBg (--lm-screen-bg), system.images.screen (--lm-screen-image), system.fg (--lm-fg)
Investigation (@investigate)Spot name.lm-investigate-tipsystem.screenBg (--lm-screen-bg), system.border (--lm-border), system.radius (--lm-radius)
Spot.lm-investigate-spotsystem.radius (--lm-radius), system.fg (--lm-fg-muted)
Investigation.lm-investigatesystem.fg (--lm-fg), system.font (--lm-ui-font)
Map choice (@map-choice)Detail panel.lm-map-choice-panelsystem.screenBg (--lm-screen-bg), system.border (--lm-border), system.radius (--lm-radius)
Spot.lm-map-choice-spotsystem.radius (--lm-radius), system.fg (--lm-fg)
Map.lm-map-choicesystem.fg (--lm-fg), system.font (--lm-ui-font)
Chapter card and chapter end (@chapter-card, @chapter-end)Chapter number.lim-chapter-numberchapter.accent (--lim-chapter-accent), chapter.numberSize (--lim-chapter-number-size)
Chapter title.lim-chapter-titlechapter.size (--lim-chapter-size), chapter.letterSpacing (--lim-chapter-letter-spacing), chapter.color (--lim-chapter-fg), chapter.font (--lim-chapter-font)
Divider.lim-chapter-rulechapter.rule (--lim-chapter-rule), chapter.accent (--lim-chapter-accent)
Subtitle.lim-chapter-subtitlechapter.subtitleColor (--lim-chapter-subtitle-fg), chapter.subtitleSize (--lim-chapter-subtitle-size)
Background.lim-chapterchapter.background (--lim-chapter-bg), chapter.image (--lim-chapter-image), system.titleBg (--lm-title-bg)
Cut-in (@cutin)Cut-in.lim-cutin-frame—
HUD (@hud)Buttons.lim-hud-buttonmessage.background (--message-bg), message.borderColor (--message-border), text.color (--message-fg), text.size (--text-size)
Text.lim-hud-texttext.color (--message-fg), text.font (--font), text.size (--text-size), text.shadow (--text-shadow)
Chat screen (@chat-open, ui.chat.dialogue)Name.lim-chat-namechat.nameColor (--chat-name)
Narration.lim-chat-notechat.noteColor (--chat-note)
Own bubble.lim-chat-row.is-me .lim-chat-bubblechat.meBackground (--chat-me-bg), chat.meColor (--chat-me-fg), chat.radius (--chat-radius), chat.tailRadius (--chat-tail-radius)
Other’s bubble.lim-chat-bubblechat.otherBackground (--chat-other-bg), chat.otherColor (--chat-other-fg), chat.radius (--chat-radius), chat.tailRadius (--chat-tail-radius)
Header.lim-chat-headchat.headBackground (--chat-head-bg), chat.headColor (--chat-head-fg)
Chat screen.lim-chatchat.background (--chat-bg), chat.image (--chat-image), chat.font (--chat-font), chat.size (--chat-size), chat.color (--chat-fg)

Changing a screen’s structure with templates

The screens in the table below are written as HTML templates with attributes. Put the screen name and a template file in ui.templates in liminalia.json, and you can change in HTML what CSS cannot reach (order, nesting, extra text).

{ "ui": { "templates": { "menu": "ui/screens/menu/menu.html", "choice": "ui/screens/choice/choice.html" } } }
  • A template is a list of <template data-part="part name" data-version="version">. Copy the standard template (packages/screens/src/<screen>.ts) and edit it. Only the parts you write replace the standard ones, so you can replace just one choice or just one row of the controls table
  • The engine gives elements with data-role their action, keys, gamepad, focus and sound. data-field and data-attr-<attribute> receive the screen’s values, and data-text receives the standard wording. An element whose data-if value is empty is not shown
  • The engine writes states as data-lm-* (data-lm-focus, data-lm-disabled, data-lm-read, data-lm-current and so on), so style them from CSS
  • The menu shows the items in the order you write them. Items that cannot be used right now (such as quitting in the browser version) are removed by the engine even if you write them
  • For choices, the frame (screen) and a single choice (option, option-image for pictures, option-area for an invisible area) can be replaced separately. The outermost element of screen stands for the choice layer (.choices) itself; its classes and attributes are put on the layer only while choices are shown
  • For save and load, you can replace just one slot row (slot). Empty, locked and source slots get data-lm-empty, data-lm-protected and data-lm-source, and the tab of the current page gets data-lm-current
  • For the backlog, you can replace just one page (entry). The element with data-field="text" receives the text with its ruby and colors. The search box is an input with data-input="search"; typing lists only the pages that match
  • The title screen shows the items in the order you write them. “Continue” cannot be pressed while there are no saves, and items that cannot be used right now (such as quitting in the browser version) are removed by the engine even if you write them. The background, music and logo still come from ui.title
  • On the settings screen, write data-setting="setting name" on each item’s row (bgm, skipUnread and so on; a game’s own setting is custom.name). Inside the row, an <input> becomes a slider, elements with data-value become choices, and an element with data-toggle becomes a switch, all tied to the setting’s value. Remove a row to remove the item, and reorder rows to reorder items. Items that can’t be used right now (desktop-only items and so on) are removed by the engine even if written. Tabs are buttons with data-role="page" and data-page="name"; pressing one shows only the elements whose data-page includes that name
  • If a plugin’s screens.* replaces the same screen, the plugin wins. The attribute rules and each part’s values are in design/screen-templates.md

The table is generated from packages/screens/src/ (with npx tsx packages/web/scripts/screen-catalog.ts, like the table above).

ScreenKey in ui.templatesParts (version)Actions (data-role)Values (data-field, data-if, data-attr-*)
Confirmationconfirmscreen 2ok, cancel, closemessage, yes, no, kind
Menumenuscreen 1, screen-button 1system action names (SYSTEM_ACTIONS), close, openauto, skip, label
Controls helphelpscreen 1, tab 1, controls 1, row 1, page 1close, pagetabs, label, current, keyboard, touch, pad, title, image, text
Ending nameendingscreen 1proceed, closename, kind, kind-label, mark, proceed, spoken
Choiceschoicescreen 1, option 1, option-image 1, option-area 1choosetimer, text, image, index
Save and loadsaveloadscreen 1, page 1, banner 1, slot 1, memo 1close, page, cancel, pick, memo, protect, copy, move, deleteheading, label, current, spoken, message, name, date, chapter, time, sub, text, memo, thumb, locked, tools, protect, placeholder
Backlogbacklogscreen 1, entry 1, empty 1close, voice, jumpsearch-label, count, name, text, voice-label, jump-title
Titletitlescreen 1start, load, extra, flowchart, config, help, exitname, logo, heading
Settingsconfigscreen 1, option 1, speaker 1, binding 1close, page, reset, export, import, reset-controls, changetextSpeed, autoWait, windowOpacity, textScale, master, bgm, se, voice, filter-label, preview, controls, label, lang, volume, keys, waiting

Examples

Change the ending-name screen with theme values (the ui of theme.json or liminalia.json). Anything you leave out keeps the system screen colors (system.titleBg, fg, accent) and the text font.

"ending": { "background": "#0d0a08", "color": "#e9dcc0", "size": 56, "rule": "none", "mark": "above", "markColor": "#b08a4a" }
KeyMeaning
background, imageThe backdrop (CSS background) and a picture laid on it (from bgimage; cropped to fill the screen)
font, color, size, letterSpacingFont, color, size (px; default 48) and letter spacing (default 0.16em) of the name
kindColorColor of the kind label (BAD END and so on) shown above the name when title= is given
ruleColor of the rule between the name and the closing mark. none draws no rule
mark, markColor, markSizeWhere the closing mark goes (below: under the name, the default; above: above the name; none: not shown), its color and its size (px; default 26)

Change the closing mark’s text (“The End”) with the text key ending.mark, and the kind labels with ending.kinds.<kind> and endingKinds in liminalia.json. In CSS you can override .lm-ending, .lm-ending-name, .lm-ending-rule, .lm-ending-mark and so on (the game’s CSS wins over the ui.ending values).

Chapter cards and chapter ends (@chapter-card, @chapter-end) are changed the same way with ui.chapter. Anything not set keeps the system screen colors and the text font.

"chapter": { "background": "#0d0a08", "color": "#e9dcc0", "size": 60, "accent": "#b08a4a", "rule": "none", "endSize": 40 }
ItemContents
background, imageThe backdrop (CSS background) and a picture laid on it (from bgimage, cropped to fill the screen; the command’s image= is shown on top of it)
font, colorFont and text color
size, letterSpacingTitle size (px; 52 by default. The title of a chapter end is 8/13 of it, and the card title in a portrait game 10/13) and letter spacing (0.12em by default)
accent, numberSizeColor of the chapter number and the rule, and the number’s size (px; 22 by default)
subtitleColor, subtitleSizeSubtitle color and size (px; 18 by default)
ruleColor of the rule between the title and the subtitle. none draws no rule
endColor, endSizeColor and size of the closing mark of a chapter end (px; 44 by default)

Change the closing mark’s text of a chapter end with the text key chapter.end or text= of @chapter-end. In CSS you can override .lim-chapter, .lim-chapter-title, .lim-chapter-rule and so on.

Make the choices your own screen (a plugin’s ./web):

export default defineWebPlugin({
  name: "cards",
  screens: {
    choice: (api) => {
      const row = document.createElement("div");
      row.className = "my-choices";
      for (const o of api.options) {
        const b = document.createElement("button");
        b.textContent = o.text;
        b.disabled = o.locked;
        b.onclick = () => api.choose(o.index);
        row.append(b);
      }
      return row;
    },
  },
});