fix(#3397): use existing design tokens in Astro docs#3515
Conversation
✅ Deploy Preview for goa-design-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Updates the v2 docs’ Astro base layout to stop redefining GoA design-token CSS variables inline and instead rely on the shared design token styles already imported into the layout.
Changes:
- Removed the custom
:rootdesign token overrides fromBaseLayout.astro. - Switched global base styles (body/headings/links/focus) to reference existing GoA design tokens.
There was a problem hiding this comment.
Looks good @bdfranck . A few things I noticed that we should address:
- Other files still use the removed custom properties
Most of the removed :root properties were duplicates of real V2 tokens (--goa-color-text-secondary, --goa-space-*, etc.) so those will keep working fine. But a few were not real V2 tokens, and other files still reference them:
- ExampleCard.astro uses --goa-color-border, --goa-color-background-light, --goa-color-brand, --goa-radius-s/m
- ComponentSandbox.tsx uses --goa-color-border, --goa-color-brand, --goa-radius-m (these have inline fallbacks so they won't break visually, but still worth migrating)
- GuidanceGrid.astro uses --goa-color-background-light, --goa-radius-m
We should either keep those properties in :root for now, or update those files too. We can create a separate issue for migrating them if we want to keep this PR focused.
- Inline code loses its background
code background went from --goa-color-background-light (#f5f5f5, light grey) to --goa-color-greyscale-white (#fff). Since the page background is also white, inline code blocks won't have any visual distinction. Maybe something like --goa-color-greyscale-100 to keep the contrast?
- Mobile header hardcoded values
font-size: 18px, margin-left: -8px, background: white. Since we're already in this file, these should move to tokens too.
1a76c0c to
a3b32d1
Compare
|
@twjeffery I've amended my commit with changes that address you above three comments. |
vanessatran-ddi
left a comment
There was a problem hiding this comment.
I have some comments about using a token instead of hard-code values
09641d2 to
47b2cb3
Compare
Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>
|
@vanessatran-ddi I've replaced the instances you mentioned and did a find and replace of similar ones. |
Before (the change)
The Astro layouts and components for our v2 Docs used custom design tokens that overwrote some existing ones.
After (the change)
The Astro layouts and components for our v2 Docs uses existing design tokens.
Make sure that you've checked the boxes below before you submit the PR
Steps needed to test