Skip to content

fix: emit CSS for enum-valued state variants without explicit value (#157)#161

Closed
nathanacurtis wants to merge 2 commits into
release/schema-0.25.0-cli-0.21.0from
main
Closed

fix: emit CSS for enum-valued state variants without explicit value (#157)#161
nathanacurtis wants to merge 2 commits into
release/schema-0.25.0-cli-0.21.0from
main

Conversation

@nathanacurtis

Copy link
Copy Markdown
Member

Summary

When config.processing.states maps a prop to a concept without specifying a value (e.g. selected: { prop: selected }), enum-valued variants like Selected=Selected were silently skipped — only selected::true was registered in the lookup, so the enum value never matched and its styling never reached styles.css.

The fix registers the concept name itself as a secondary lookup key when no value is specified, and uses a case-insensitive fallback in the CSS transformer so Selected=Selected resolves to the selected concept and emits [aria-selected="true"].

Test coverage

  • buildStateLookup now registers prop::conceptName in addition to prop::true when no value is configured; confirmed it does NOT add the extra key for explicit-value entries.
  • New CSS transformer test: enum prop selected: { prop: 'selected' } emits [aria-selected="true"] for Selected=Selected, :indeterminate for explicit Indeterminate value, and skips the rest value Unselected.
  • Regression test: boolean props (disabled::true) continue to work unchanged.

Closes #157

nathanacurtis and others added 2 commits June 15, 2026 15:58
…ldren (ADR-056) (#158)

* chore(release): improve changelog quality guidance in release agents

Require human-friendly prose in release summaries and individual bullets
("So what?" framing, not API descriptions). Add empty-section pruning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(schema): rename SlotProp.minItems/maxItems to minChildren/maxChildren (ADR-056)

Aligns slot constraint field names with Figma native slotSettings API.
Adds anyOf to SlotProp, populated from preferredValues when allowPreferredValuesOnly
is true. Bumps schema to 0.25.0 (breaking change).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* adr(056): mark ADR-056 as accepted

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: update slot constraints docs for minChildren/maxChildren rename (ADR-056)

Updates schema/props, config/slot-constraints, guides/slot-constraints, and
analyze/props to reflect the minItems/maxItems → minChildren/maxChildren rename
and the new native slotSettings source alongside code-only props.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@nathanacurtis

Copy link
Copy Markdown
Member Author

Closing — recreating with correct head branch (fix/css-enum-state-variants-157).

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