Skip to content

docs(radio): add styling API documentation and remove unused classes#700

Open
Skadefryd wants to merge 4 commits into
nextfrom
refactor/radio-docs
Open

docs(radio): add styling API documentation and remove unused classes#700
Skadefryd wants to merge 4 commits into
nextfrom
refactor/radio-docs

Conversation

@Skadefryd

Copy link
Copy Markdown
Contributor

Added comprehensive styling documentation for radio component that was previously marked as partial (had tokens but missing docs).

Changes:

  • Created docs/styling.md with all component tokens documented:
    • Label tokens (font-size, line-height, color, color-disabled)
    • Control tokens (size, gap, radius, border-width, checked-border-width)
    • Color tokens for all states (default, checked, invalid, disabled)
    • Focus tokens (outline width, color, offset)
    • Cursor tokens (default, disabled)
    • Animation tokens (transition)
  • Documented all parts: control, label
  • Added usage examples for common customizations
  • Explained rich label content via slot (same as checkbox)
  • Noted high contrast mode support
  • Explained custom implementation using ElementInternals vs native input

Code cleanup:

  • Removed unused class attributes (control, label)
  • Kept wrapper class (used by CSS for layout)
  • No functional changes - parts remain exposed for customization

Architecture documentation:

  • Added implementation note explaining custom role="radio" approach
  • Added TODO noting checkbox inconsistency (uses hidden native input)
  • Suggests future alignment after backwards compatibility assessment

Completes Phase 2 radio documentation.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://warp-ds.github.io/elements/pr-preview/pr-700/

Built to branch gh-pages at 2026-06-23 07:42 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Added comprehensive styling documentation for radio component that was
previously marked as partial (had tokens but missing docs).

Changes:
- Created docs/styling.md with all component tokens documented:
  - Label tokens (font-size, line-height, color, color-disabled)
  - Control tokens (size, gap, radius, border-width, checked-border-width)
  - Color tokens for all states (default, checked, invalid, disabled)
  - Focus tokens (outline width, color, offset)
  - Cursor tokens (default, disabled)
  - Animation tokens (transition)
- Documented all parts: base, control, label
- Added usage examples for common customizations
- Explained rich label content via slot (same as checkbox)
- Noted high contrast mode support
- Explained custom implementation using ElementInternals vs native input

Code cleanup:
- Removed unused class attributes (control, label)
- Replaced wrapper class with part="base" for consistency
- Removed redundant .wrapper CSS (styles already on :host)
- Exposes wrapper as ::part(base) for advanced customization
- No functional changes - maintains same layout and behavior

Architecture documentation:
- Added implementation note explaining custom role="radio" approach
- Added TODO noting checkbox inconsistency (uses hidden native input)
- Suggests future alignment after backwards compatibility assessment

Completes Phase 2 radio documentation.
@Skadefryd Skadefryd force-pushed the refactor/radio-docs branch from 8b8c913 to 777f9a5 Compare June 15, 2026 12:03
The previous commit removed unused classes from the radio component.
Tests need to use [part="control"] instead of .control selector.
Comment thread packages/radio/radio-styles.ts Outdated
Snorre Nygaard and others added 2 commits June 23, 2026 09:27
The wrapper layout styles (display: inline-flex, align-items, gap) were
incorrectly placed on :host when the .wrapper class was removed. These
styles don't cascade to shadow DOM children, so the radio circle and
label were not being laid out correctly.

Moved the layout styles to [part='base'] where they apply to the actual
wrapper element that contains the control and label.

Co-Authored-By: Claude Sonnet 4.5 <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.

3 participants