Skip to content

Addon parts ​

A theme addon styles claude-ui with CSS. To find the element to style, select a part: an element that carries data-part="<name>". A part name is stable. The class names and the data-testid values of the app are not: they may change in any release and break your theme.

css
:root[data-theme="addon:my-addon:night"] [data-part="user-message"] {
  border-left: 3px solid var(--primary);
}
:root[data-theme="addon:my-addon:night"] [data-part="tab"][data-state="running"] {
  outline: 1px solid var(--ring);
}

Rules ​

  • Select [data-part="..."], never [data-testid="..."]. data-testid is a test hook.
  • State is an attribute on the part itself. The table lists the attributes a part has. Other attributes are not part of the contract.
  • A part is removed only after one minor release in which it is marked deprecated in the table. A new part gets a since version.
  • The list is also in packages/protocol/src/addon-parts.ts (PARTS, PART_NAMES, PartName, PARTS_VERSION).

Browser support ​

Theme CSS (themes[].css) needs CSS nesting: Chrome 120, Safari 17.2 (iOS 17.2) or Firefox 117, or newer. The palette and vars of a theme work in older browsers too, but the rules of its CSS file are dropped there, so the theme shows its colours only.

Cascade ​

The CSS file of an addon (css in addon.json) is loaded in its own cascade layer, addon.<name>, after the styles of the app itself. Order: theme, base, components, utilities, host, addon.

  • Your rules win over the app's rules without !important and without a long selector. Do not add !important to win over the app.
  • Exception, libraries: the styles of CodeMirror (.cm-*, the file editor), the terminal (.xterm*), KaTeX (.katex*) and the code highlighter are not in a layer, so they beat your rules whatever the selector. Add !important to override them.
  • Exception: a declaration with !important inside the app's built-in Neon theme (including its editor, terminal and code-highlighter declarations) beats yours, and only while Neon is the picked theme.
  • An inline style attribute of an element still wins over a layer. Add !important in your rule to override it. A few app elements use Tailwind !important utilities (for example px-0!); they beat your !important too.
  • Your own layers inside the file work as usual, for example @layer base, effects;; they sit inside addon.<name>.

Lifecycle ​

Attributes that say what the open session is doing, so a theme can react. The app sets them from the session state, for every engine (Claude Code and OpenCode).

AttributeOnValue
data-phasesession-area and <html>, for the open sessionthinking (a turn runs, an OpenCode retry too), waiting (a permission or a question needs you), idle. On the Focus page and a new tab: idle.
data-just-finishedsession-areaPresent for 1200 ms after the open session went from thinking to idle. Gone when a new turn starts. Not set after waiting, and not when you switch to another session.
data-focus-openedfocus-pagePresent for 1200 ms after the Focus page opens.
data-motion<html>on or off. off while the system asks for reduced motion (live).
data-page-hidden<html>Present while the browser tab is hidden. The app pauses every CSS animation then, yours included (animation-play-state: paused !important in the host layer, which beats your !important).
css
[data-part="session-area"][data-just-finished] { animation: flash 1.2s ease-out; }
:root[data-motion="off"] * { animation: none !important; }

The 1200 ms hold is on purpose: a CSS animation stops when its selector stops matching, so one frame is too short.

Performance budget for animations:

  • Animate transform and opacity only. Do not animate filter, box-shadow or backdrop-filter on large surfaces.
  • Few infinite animations (3 or less at the same time). Prefer one on the whole page to one per row.
  • Respect data-motion="off": a theme with motion needs a still version.

Parts ​

PartElementState attributesSince
titlebarTop bar with the tab strip1.5
sidebarSession list column1.5
session-itemOne session button in the sidebardata-state: running, needs_input, idle, error, closed1.5
session-searchSearch box of the session list1.5
group-toggleProject group header in the session list1.5
day-headerDay heading in the session list1.5
work-areaColumn that holds the session area and the bottom panel1.5
session-areaThe open session: header, timeline, prompt boxdata-phase: thinking, waiting, idle; data-just-finished (see Lifecycle)1.5
session-headerHeader of the open session1.5
tabOne tab in the tab stripdata-state: new, running, needs_input, unread, idle; data-active on the open tab1.5
focus-tabThe Focus tab1.5
terminal-tabOne terminal tab1.5
side-panelPanel next to the chat (files, changes, graph)1.5
files-panelFiles pane1.5
file-treeFile tree inside the files pane1.5
graph-panelGit graph pane1.5
terminalTerminal panel1.5
user-messageA message you sent1.5
assistant-textA text reply of Claude1.5
thinkingThe thinking row1.5
tool-cardA tool calldata-status: pending, running, done, error, denied, stopped1.5
permission-panelPermission question above the prompt box1.5
question-panelQuestion from Claude above the prompt box1.5
plan-windowOne usage window row of the plan meterdata-level: ok, warning, limit1.5
prompt-boxThe prompt box1.5
prompt-toolbarToolbar row of the prompt box1.5
markdown-toolbarMarkdown formatting toolbar1.5
sendSend button (not the stop button)data-state: idle, running, needs_input, disconnected1.5
context-meterContext usage meter1.5
context-barBar inside the context usage popup1.5
status-barStatus line under the prompt box1.5
focus-pageThe Focus pagedata-focus-opened (see Lifecycle)1.5
focus-rowOne row of the Focus list1.5
focus-queueQueue column of the Focus page1.5
toast-regionArea that holds the toasts1.5
scroll-to-bottomButton that jumps to the newest message1.5
paletteCommand palette1.5
commit-messageCommit message field1.5
changed-fileOne file row in the changes list1.5
file-diffDiff of one file1.5
loaderThe loading mark: the spinner of a running tool call, a running session row and a running tab. Holds the theme's loader slot image when it has one; <html> has data-slot-loader then1.5
done-iconThe done mark (check) of a finished tool call. Holds the theme's done-icon slot image when it has one; <html> has data-slot-done-icon then1.5
backdropFull-window background image of a theme with a background. Only in the page while the image file exists; fixed behind the app1.5

Checks ​

The Addons dialog lists Checks under each addon: warnings from the addon lint. A warning never blocks an install or an enable. Each shows the file and, where it has one, the line.

CheckMeaningFix
selects-testidA selector uses [data-testid]. It is a test hook and changes without notice.Select [data-part="..."].
unknown-part[data-part="x"] names a part that is not in the table, or ^=, $=, *=, `=` has a value that no part name can match. It matches nothing. A near name is offered ("Did you mean").
deprecated-partThe selector uses a part that is on its way out.Move to the replacement before the named release.
unprefixed-nameAn @keyframes, @font-face family or @property name has no addon prefix. These names are global and can replace a name of the app. The daemon renames the @keyframes, @counter-style and @font-palette-values of a themes[].css itself (the top-level css is not renamed); @font-face and @property stay global.Name it <addon>-name (--<addon>-name for @property).
top-level-csscss in addon.json applies to every theme, and the addon has themes.Move it to themes[].css.
css-brokenThe CSS does not parse: an unclosed block, comment or url(, a stray }, or groups nested over 32 deep. A theme CSS is then served empty: the theme keeps its palette and loses its rules.Fix it.
css-too-largeThe file is larger than 512 KB. A theme CSS is then served empty: the theme keeps its palette and loses its rules.Split or shrink it.
css-largeThe file is larger than 256 KB (the limit is 512 KB).Shrink it before it reaches the limit.
asset-missingAn assets file is not in the addon folder yet (background or slot image). The theme shows no background, or the built-in mark.Add the file.
asset-largeAn image is over 2 MB.Shrink it.
extends-missingA theme's extends cannot be used: no such theme, its addon is not enabled, a loop, or more than 3 links. The theme works without it.Fix the value or enable the addon.
low-contrastA text colour of a palette has less than 4.5:1 contrast on its background: fg and muted on bg, fg on card, pfg on primary, err, ok and warn on bg. It names the pair, the ratio and the mode. border is not checked.Change the colour.

@keyframes, @counter-style and @font-palette-values names in a themes[].css are renamed by the app, so they are not checked there (they are in the top-level css).

Changelog ​

  • Parts version 1: the parts above.
  • Lifecycle attributes data-phase, data-just-finished, data-focus-opened, data-motion, data-page-hidden (not a part change).

MIT licensed. Unofficial; not affiliated with Anthropic.