Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Migrates ~293 files in packages/sanity/src from styled-components to
@vanilla-extract/css. This removes all `import {styled} from 'styled-components'`
and `import {useTheme} from 'styled-components'` usage from the sanity package.
Migration patterns applied:
- styled(UIComponent) → base component with className prop
- styled.div/span → .css.ts files with style() and && selectors
- getTheme_v2(props.theme) → useTheme_v2() hook
- theme.sanity.* → useTheme_v2() with direct property access
- Dynamic props → createVar() + assignInlineVars()
- createGlobalStyle → globalStyle() in .css.ts files
- Child/descendant selectors → globalStyle() (style() only targets &)
- CSS custom properties (var(--card-*)) preserved as-is
New files: ~289 .css.ts vanilla-extract style files
Deleted files: ~26 .styled.ts/.styled.tsx/.styles.tsx files replaced by .css.ts
Modified files: ~295 component files updated
@sanity/ui continues to use styled-components internally.
useTheme_v2() from @sanity/ui still works because @sanity/ui's
ThemeProvider wraps children in styled-components' ThemeProvider.
Co-authored-by: luke <luke@miriad.systems>
…tion - Fix 14 files with syntax errors (leftover styled-components code, missing imports) - Fix forwardedAs → as prop migration across 15+ files - Fix assignInlineVars type errors (rem(0) returns number, needs String()) - Fix theme v2 API mismatches (color.card.dark → _dark, etc.) - Fix wrapper component types (className, style, tone props) - Fix .ts → .tsx renames for files with JSX - Fix restricted Popover import(use ui-components) - Fix React hooks dependency arrays - Auto-fix lint errors (unused imports, duplicate imports, sort) - Remove leftover styled-components template literals ~150 files changed, typecheck: 0 errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What to review
Testing
Notes for release