Skip to content

fix(ui): add the missing # to oc-2's light icon-weak-base - #177

Merged
quickbeard merged 1 commit into
mainfrom
icon-weak-hex
Aug 10, 2026
Merged

quickbeard merged 1 commit into
mainfrom
icon-weak-hex

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

packages/ui/src/theme/themes/oc-2.json line 28 declared the light variant's icon-weak-base as C7C7C7 — no #. Dark (line 264) was always correct.

-      "icon-weak-base": "C7C7C7",
+      "icon-weak-base": "#C7C7C7",

#C7C7C7 is unambiguously what was meant: it matches text-weaker declared a few lines above in the same block.

Why it never surfaced as an error

Three things kept it quiet:

  1. The good value never gets a chance. styles/theme.css does declare --icon-weak-base: #dbdbdb, but resolved theme tokens are injected into a <style> element by theme/context.tsx, which overrides the static sheet. The typo wins the cascade.
  2. Custom properties swallow it. --icon-weak-base: C7C7C7 is a perfectly valid custom-property declaration — they accept almost any token sequence — so nothing errors at parse time.
  3. The failure lands at substitution, and its shape depends on the property. var() resolving to garbage makes the property invalid at computed-value time, which falls back to the inherited value for inherited properties and the initial value otherwise.

Measured in the running app on the default light theme:

--icon-weak-base                    →  "C7C7C7"
color: var(--icon-weak-base)        →  rgb(1, 2, 3)      // the parent's color
background: var(--icon-weak-base)   →  rgba(0, 0, 0, 0)  // transparent
--icon-base (control)               →  rgb(143, 143, 143) // fine

What was broken

Light mode only.

Site Property Result
dialog-release-notes.tsx:117 bg- inactive carousel indicators transparent
diff-changes.tsx:82 fill on <rect> in <svg fill="none"> neutral diff blocks inherit fill: none, don't render
file-tree.tsx:475 color icon inherits parent text color — full strength, not weak
settings-keybinds.tsx:493 color same
settings-models.tsx:78 color same

oc-2 is the only one of the 37 themes that declares this token literally, and the only malformed one — every other theme takes the derived neutral[6] from resolve.ts. But oc-2 is the default, so this was the default light-mode experience.

Upstream

This is upstream's typo, not fork drift — anomalyco/opencode@dev has the identical value at the same line. Reported as anomalyco/opencode#41503, including a suggestion to guard against recurrence (schema requiring ^#, or a warn in resolveThemeVariant). The DIVERGENCES.md row says to drop our line and take upstream's once that lands.

🤖 Generated with Claude Code

`packages/ui/src/theme/themes/oc-2.json` declared the light variant's
`icon-weak-base` as `C7C7C7`. Without the `#` it is still a valid custom
property, so it parses, and the resolved tokens are injected into a
<style> element that beats the static `--icon-weak-base` in
styles/theme.css — so the malformed value wins the cascade and only
fails at `var()` substitution, where an invalid computed value falls
back to the inherited value for inherited properties and the initial
value otherwise.

Measured on the default light theme: `color:` consumers painted their
parent's color instead of the weak grey, and `background:`/`fill:`
consumers painted nothing. That blanked the release-notes carousel
indicators and the neutral diff-changes blocks, and rendered the
file-tree, settings-keybinds and settings-models icons at full strength.

oc-2 is the only one of the 37 themes that declares this token literally
and the only malformed one; the rest take the derived neutral[6]. Dark
was always correct. Reported upstream as anomalyco/opencode#41503.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 9168808 into main Aug 10, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the icon-weak-hex branch August 13, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant