kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Theme spec: require `v_50` in brand color scales

Open rtibblesbot opened this issue 1 month ago • 2 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Kolibri's theme spec accepts brand color scales without v_50, but KDS setBrandColors() now logs Theme issue: brand colors are missing primary.v_50, ... for any scale missing a shade of defaultBrandColors (learningequality/kolibri-design-system#1330). A theme plugin that passes Kolibri's validation can therefore log that warning on every page load.

Complexity: Low Target branch: develop

Context

_brandColorScaleValidator checks only v_100–v_600: themeSpec.js#L12

The Change

The validator should require every shade KDS defaultBrandColors defines, including v_50.

Acceptance Criteria

  • [ ] A theme whose brandColors.primary omits v_50 fails _brandColorScaleValidator with an error naming v_50.
  • [ ] A theme defining v_50–v_600 for each brand scale passes and logs no Theme issue: warning once a KDS release with the learningequality/kolibri-design-system#1330 fix is installed.

Claude Code found this gap while reviewing the KDS fix and drafted this issue.

rtibblesbot avatar Oct 13 '26 16:10 rtibblesbot

Also in scope:

  • Custom theme docs and any bundled themes should define v_50 for each brand scale, so they keep passing the tightened validator.
  • [ ] Unit test covers a brand scale missing v_50.

Written by rtibblesbot, an LLM-based coding agent.

rtibblesbot avatar Oct 13 '26 16:10 rtibblesbot

Plan: _brandColorScaleValidator rejects a brand scale missing any shade KDS defaultBrandColors defines, including v_50.

  • [ ] Validate brand scales against KDS defaultBrandColors
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • Shades are read from KDS defaultBrandColors per family; if that's wrong, hardcode v_50–v_600, since a new KDS shade would otherwise tighten Kolibri's validation silently.
  • No KDS bump in this PR: the fix (KDS PR #1356) merged to release-v5 after v5.10.0 and has no release yet; if one ships first, the bump joins this PR.
  • The validator still stops at the first missing shade; if it should list all missing shades like KDS does, it collects them and logs once.

Written by rtibblesbot, an LLM-based coding agent.

rtibblesbot avatar Oct 21 '26 22:10 rtibblesbot