Lesson 2 — Restyling Phlex::UI with tokens
This lesson updates every Phlex::UI component to use semantic token
classes instead of raw palette values. The component logic is unchanged —
only the class strings change.
Components::Button
|
|
Components::Badge
|
|
Components::Alert
|
|
Components::Avatar
|
|
Components::Breadcrumb
|
|
Components::Card
|
|
Components::Checkbox
|
|
Components::EmptyState
|
|
Components::ErrorSummary
|
|
Components::FormField
|
|
Components::Heading
|
|
Components::Link
|
|
Components::Panel
|
|
Components::RadioGroup
|
|
Components::Select
|
|
Components::Table
|
|
Components::TextInput
|
|
The pattern is consistent throughout:
| Before | After |
|---|---|
bg-white |
bg-surface |
bg-gray-50 |
bg-surface-alt |
border-gray-200 |
border-border |
text-gray-900 |
text-text |
text-gray-500 |
text-text-muted |
bg-blue-600 |
bg-primary |
hover:bg-blue-700 |
hover:bg-primary-hover |
bg-red-600 |
bg-danger |
After updating all components run the test suite to confirm nothing broke — the component structure is unchanged so all tests should pass.
You can then check out all the components in Lookbook - they should look unchanged
but the underlying html should be using our new token styles.