mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-11 04:38:18 +00:00
6.9 KiB
6.9 KiB
Basecoat Multi-Style Migration Handoff
This handoff is for resuming the release/1.0.0 work on Basecoat's split CSS architecture and shadcn/ui v4 style-pack support.
Ground Truth
- Local Basecoat repo:
/Users/hunvreus/Workspace/basecoat - Local shadcn/ui upstream repo:
/Users/hunvreus/Workspace/_sandbox/shadcn-ui - Upstream branch/commit verified during this pass:
mainat460ad60d8 - Upstream style registry:
../_sandbox/shadcn-ui/apps/v4/registry/styles.tsx - Current upstream styles:
vega,nova,maia,lyra,mira,luma,sera,rhea
The earlier five-style assumption was wrong. Luma, Sera, and Rhea are current upstream styles and must be included in every component migration.
Core Rules
- Keep Basecoat's own class API (
btn,btn-outline,dialog,popover, etc.). - Do not introduce shadcn/ui
cn-*classes. - Use upstream shadcn/ui as a style reference, not as selectors to copy directly.
- Translate upstream style intent to Basecoat selectors and markup.
- Component CSS should stay structural/shared when possible.
- Style-pack CSS owns visual differences: radius, density, spacing, typography, focus rings, shadows, and style-specific variant details.
- Default aggregate behavior remains Vega.
- Non-default styles are selected by importing or loading the relevant style file, not by requiring
.style-*wrapper classes.
Files To Check For Every Component
- Basecoat component CSS:
src/css/components/<component>.css - Basecoat templates/macros if relevant:
src/nunjucks/*.njk,src/jinja/*.html.jinja - Basecoat docs page:
docs/src/components/<component>.md - Upstream base component:
../_sandbox/shadcn-ui/apps/v4/registry/bases/base/ui/<component>.tsx - Upstream styles:
../_sandbox/shadcn-ui/apps/v4/registry/styles/style-{vega,nova,maia,lyra,mira,luma,sera,rhea}.css - Basecoat styles:
src/css/styles/{vega,nova,maia,lyra,mira,luma,sera,rhea}.css
Required Process
- Review current Basecoat CSS and markup/templates/docs.
- Review upstream base component source.
- Review the component section in all eight upstream style files.
- Decide what belongs in shared component CSS versus each style file.
- Remove outdated shared visual rules if those rules are now style-owned.
- Implement the component section in all eight Basecoat style files.
- Keep Basecoat selectors only.
- Classify non-trivial differences as
intentional,drift fixed, ordeferred. - Update
migration-tracker.md. - Run
npm run build. - Run
npm run docs:buildwhen docs or docs style assets are touched. - Browser-check light/dark and all eight styles.
Do not mark a component done just because CSS compiles.
What Has Been Done
- Split CSS source into:
src/css/base/base.csssrc/css/components/*.csssrc/css/styles/*.css
- Kept
src/css/basecoat.cssas the backward-compatible default aggregate. - Added
src/css/basecoat.all.cssas an explicit all-in-one Tailwind source. - Updated
scripts/build.jsto copy split CSS folders intopackages/css/dist. - Split
selectandnative-select. - Kept
src/css/components/form.cssas a convenience aggregate rather than nesting undercomponents/form/*. - Added docs style switcher in
docs/src/_includes/partials/header.njk. - Added docs stylesheet swapping in
docs/src/_includes/layouts/base.njk. - Added docs style entrypoints for all non-default styles:
docs/css/style-nova.cssdocs/css/style-maia.cssdocs/css/style-lyra.cssdocs/css/style-mira.cssdocs/css/style-luma.cssdocs/css/style-sera.cssdocs/css/style-rhea.css
- Added Basecoat style files for all eight upstream styles:
src/css/styles/vega.csssrc/css/styles/nova.csssrc/css/styles/maia.csssrc/css/styles/lyra.csssrc/css/styles/mira.csssrc/css/styles/luma.csssrc/css/styles/sera.csssrc/css/styles/rhea.css
Button Status
Button is the only component with style-pack sections currently present.
Files involved:
src/css/components/button.csssrc/css/styles/vega.csssrc/css/styles/nova.csssrc/css/styles/maia.csssrc/css/styles/lyra.csssrc/css/styles/mira.csssrc/css/styles/luma.csssrc/css/styles/sera.csssrc/css/styles/rhea.cssdocs/src/components/button.md
Current button work includes:
- Shared button CSS moved toward structural rules.
- Visual rules moved into style files.
xsbutton and icon size classes added.- Icon-aware padding mapped with Basecoat selectors using
:has(> svg:first-child)and:has(> svg:last-child). - All eight style files have Button sections.
- Docs include
btn-xs-outlineandbtn-xs-icon-outlineexamples.
Button should remain in-progress until browser-audited across light/dark and all eight styles. Button-group adjacency is separate and should be handled during button-group.
Current Component Status
button: in progress / pending visual audit- Everything else: pending
No component besides Button should be considered migrated.
Issues Encountered
- The original migration plan assumed only five styles. Upstream now has eight.
- The first button attempt mixed old Basecoat visual rules with new style-pack rules, causing broken rendering.
- Some docs style entrypoints need
src/css/base/base.cssimported first so Tailwind can resolve semantic utilities likefocus-visible:border-ring. - Style switching should remove the override stylesheet
hreffor Vega instead of settinghref="". - Sidebar dropdown width was a tangent. The user explicitly said not to modify generic CSS for that; handle width with a Tailwind class only when that task is active.
Things Learned
- Shadcn/ui icon-aware button padding is CSS-owned, not React-owned.
- Upstream uses data hooks like
has-data-[icon=inline-start]:pl-*. - Basecoat should map that to its own markup, currently
:has(> svg:first-child)and:has(> svg:last-child). - Blind copy is not viable because upstream uses
cn-*class composition while Basecoat uses explicit classes likebtn-xs-icon-outline.
Build And Validation Commands
npm run build
npm run docs:build
npm run docs:dev
Use npm run docs:dev for manual browser review.
Remaining Work
- Run build validation after the latest Luma/Sera/Rhea wiring.
- Browser-check
/components/buttonfor all eight styles in light and dark mode. - Update Button tracker status only after visual audit.
- Migrate
button-groupnext because it interacts with button radius and adjacency. - Continue component-by-component using
migration-tracker.md.
Current Risks
- Button may still have visual deltas from upstream until audited.
- Docs style override assets may duplicate base CSS because they import base utilities for Tailwind compilation.
- The package does not currently generate separate style-specific CDN bundles beyond split style exports.
- The worktree includes unrelated sidebar template changes; do not revert or fold them into style migration unless explicitly requested.