Skip to content

refactor(form): migrate to semantic tokens and shared focus ring - #113

Merged
ksierks merged 2 commits into
mainfrom
refactor/form-semantic-tokens
Jul 13, 2026
Merged

refactor(form): migrate to semantic tokens and shared focus ring#113
ksierks merged 2 commits into
mainfrom
refactor/form-semantic-tokens

Conversation

@joshsadam

@joshsadam joshsadam commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do and why?

  • Migrates Pathogen::Form checkbox, radio, and switch styling to semantic --pvc-* tokens, replacing raw neutral-* surfaces and black/white focus outlines with --pvc-color-surface and --pvc-color-focus.
  • Consolidates Form Lookbook previews into a single overview page and updates design-system migration docs.

Closes #90

Screenshots or screen recordings

  • N/A (token migration; control surfaces and focus changes are subtle in light/dark)

How to set up and validate locally

  1. bin/setup (or ensure the dev environment is loaded)
  2. bin/test test/components/pathogen/form/ test/lib/pathogen/form_builders/pathogen_form_builder_test.rb
  3. pnpm run build:css:check
  4. Open the Form overview preview in Lookbook and verify checkbox, radio, and switch in light and dark mode

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates Pathogen form control styling (checkboxes, radios, switches, and builder/tag helpers) from raw Tailwind palette classes to semantic --pvc-* design tokens, while standardizing focus rings on --pvc-color-focus. It also updates the design-system docs to reflect the new migration state and refreshes the compiled CSS artifact accordingly.

Changes:

  • Replace neutral/primary utility usage in shared form control styles with semantic --pvc-color-* tokens (including removing dark:bg-neutral-950 from everyday controls).
  • Converge focus-visible outlines (and peer focus outlines for Switch) on outline-[var(--pvc-color-focus)], updating/expanding tests to enforce this.
  • Sync design-system documentation and regenerate the CSS build output to match the new class usage.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/lib/pathogen/form_builders/pathogen_form_builder_test.rb Updates assertions to require semantic focus outline classes and forbid legacy black/white outlines.
test/components/pathogen/form/switch_test.rb Adds coverage ensuring Switch emits semantic surface + focus token classes and no longer emits legacy outline classes.
test/components/pathogen/form/radio_button_test.rb Updates border + focus outline expectations to semantic token forms and forbids legacy focus outline classes.
lib/pathogen/styles/form_styles.rb Migrates shared checkbox helper classes (builder/tag helper path) to semantic tokens and standardized focus ring.
docs/lookbook/design_system/02-tokens.md.erb Updates token migration table to reflect Tabs/Form “Yes” status and Link remaining partial.
docs/lookbook/design_system/01-design-contract.md.erb Updates stated migration status and focus-ring convergence text to match the new Form/Tabs behavior.
app/components/pathogen/form/switch_styles.rb Migrates Switch label, track, checked state, and focus ring styling to semantic tokens.
app/components/pathogen/form/form_styles.rb Migrates shared control base + label/help text styling to semantic tokens and shared focus ring.
app/assets/stylesheets/pathogen_view_components.css Regenerates compiled CSS output to reflect class/token changes and removed legacy utilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joshsadam joshsadam self-assigned this Jul 10, 2026
@joshsadam
joshsadam requested a review from ksierks July 10, 2026 16:44
Comment thread app/assets/stylesheets/pathogen_view_components.css
…ring

Form checkboxes, radios, switches, and form-builder checkbox styling now use
--pvc-* surface, border, text, accent, and focus tokens instead of raw
neutral/primary utilities and black/white focus outlines.

Closes #90
Replace separate checkbox, radio, switch, and required-field preview groups
with one design-contract overview covering fieldsets, control states, table
selection, radio groups, switches, external labels, and required markers.
@joshsadam
joshsadam force-pushed the refactor/form-semantic-tokens branch from 36d11c3 to 9879501 Compare July 13, 2026 14:21
@ksierks
ksierks merged commit 7058028 into main Jul 13, 2026
3 checks passed
@ksierks
ksierks deleted the refactor/form-semantic-tokens branch July 13, 2026 14:31
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.

refactor(form): use semantic tokens and fix dark control backgrounds

3 participants