Skip to content

feat(light): add semantic shadow and accent-focus tokens for DIAL UI Kit - #156

Open
PolinaGurinovich97 wants to merge 1 commit into
developmentfrom
feat/light-theme-shadow-focus-tokens
Open

PolinaGurinovich97 wants to merge 1 commit into
developmentfrom
feat/light-theme-shadow-focus-tokens

Conversation

@PolinaGurinovich97

Copy link
Copy Markdown
Collaborator

Problem

@epam/ai-dial-ui-kit reads six colour tokens that the light theme never defined:

Kit reads Where in the kit Light theme had
--shadow-xs-1 boxShadow.xs only shadow-blue-500-alpha-20
--shadow-xs-2 boxShadow.xs only shadow-grey-1000
--shadow-sm boxShadow.sm only shadow-blue-500-alpha-8
--shadow-md boxShadow.md nothing exact (shadow-blue-500-alpha-4 is 4%, kit wants 6%)
--shadow-lg boxShadow.lg only shadow-blue-500-alpha-8
--stroke-accent-focus borderColors only stroke-focus-blue

The theme exposed the values under palette-style names, which the kit never looks up. Result: every shadow step and the accent focus ring in the light theme silently fell back to the hardcoded defaults compiled into the kit — a host could not retheme them.

Found by diffing themes[id=light].colors against the CSS variables referenced by the kit's tailwind.config.js, excluding the deprecated *ColorsToRemove sets.

Change

Six keys added to themes[id=light].colors:

"stroke-accent-focus": "#6785FB",

"shadow-xs-1": "#2764D933",
"shadow-xs-2": "#161B2D08",
"shadow-sm": "#2764D914",
"shadow-md": "#2764D90F",
"shadow-lg": "#2764D914"

Values are taken from the kit's own fallbacks, so rendering is unchanged — this only moves the shadow scale and accent focus ring from hardcoded to themable. shadow-md is the one value with no exact existing alias (6% vs the 4% of shadow-blue-500-alpha-4); it follows the kit.

Compatibility

Purely additive — no key renamed or removed. Consumers still reading shadow-blue-500-alpha-*, shadow-grey-1000 or stroke-focus-blue are unaffected.

Not included

Five kit variables remain undefined in the light theme, all deliberately — each is a second-level fallback whose primary name is already present:

  • --bg-control-accent-gradient-from / -to / -hover-from / -active-to → primaries --bg-gradient-1 / -2 (+ hover/active) are defined.
  • --bg-control-neutral-hover → primary --bg-control-neutral-hover-muted is defined, and development removed this alias on purpose in the 0.14.0 alignment.

The dark theme is out of scope here: it is missing the whole 2.0 token layer (69 keys vs 142), which is a separate piece of work.

Verification

  • JSON.parse on the full file passes.
  • Re-ran the token diff: the six gaps are closed, only the five intentional fallbacks above remain.

🤖 Generated with Claude Code

The UI Kit reads its shadow scale from `--shadow-xs-1`, `--shadow-xs-2`,
`--shadow-sm`, `--shadow-md` and `--shadow-lg` (tailwind.config.js
`boxShadow`), and its accent focus ring from `--stroke-accent-focus`.
None of those names existed in the light theme: the same values were
exposed only under palette-style names (`shadow-blue-500-alpha-20`,
`shadow-grey-1000`, `stroke-focus-blue`), which the kit never looks up.
Every shadow and the accent-focus outline therefore fell back to the
hardcoded defaults baked into the kit and could not be themed.

Values match the kit's own fallbacks, so rendering is unchanged:

- shadow-xs-1  #2764D933  (= shadow-blue-500-alpha-20)
- shadow-xs-2  #161B2D08  (= shadow-grey-1000)
- shadow-sm    #2764D914  (= shadow-blue-500-alpha-8)
- shadow-md    #2764D90F  (6% blue-500; the nearest existing alias
                           shadow-blue-500-alpha-4 is 4%, so it was
                           not an exact match)
- shadow-lg    #2764D914  (= shadow-blue-500-alpha-8)
- stroke-accent-focus #6785FB (= stroke-focus-blue)

Additive only — no existing key is renamed or removed, so consumers
still reading the palette-style names keep working.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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