-
Notifications
You must be signed in to change notification settings - Fork 446
feat(expo): add native component theming via Expo config plugin #8243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3f2f058
feat(expo): add native component theming via Expo config plugin
chriscanin 221e30c
fix(expo): apply Android theme after Clerk.initialize and use real Cl…
chriscanin b5af733
chore(expo): add changeset for native component theming
chriscanin 19bc65a
fix(expo): reject 3-digit hex in theme validation and fix Android 8-d…
chriscanin 3c703ef
fix(expo): stop removing UIUserInterfaceStyle when darkColors is present
chriscanin 665952e
chore(expo): update changeset to reflect UIUserInterfaceStyle change
chriscanin 64521d0
fix(expo): fix iOS theme parsing for clerk-ios 1.0.0 API
chriscanin 2490b35
fix(expo): strict object validation in theme JSON and add tests
chriscanin 578ac31
fix(expo): add top-level object validation and remove stale JSDoc
manovotny 4786284
fix(expo): address review feedback on theming PR
chriscanin 257de36
chore(expo): remove stale ClerkViewFactory.swift template
chriscanin 1ae23f1
fix(expo): suppress no-require-imports lint error in theme test
chriscanin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| '@clerk/expo': minor | ||
| --- | ||
|
|
||
| Add native component theming via the Expo config plugin. You can now customize the appearance of Clerk's native components (`<AuthView />`, `<UserButton />`, `<UserProfileView />`) on iOS and Android by passing a `theme` prop to the plugin pointing at a JSON file: | ||
|
|
||
| ```json | ||
| { | ||
| "expo": { | ||
| "plugins": [ | ||
| ["@clerk/expo", { "theme": "./clerk-theme.json" }] | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| The JSON theme supports: | ||
|
|
||
| - `colors` — 15 semantic color tokens (`primary`, `background`, `input`, `danger`, `success`, `warning`, `foreground`, `mutedForeground`, `primaryForeground`, `inputForeground`, `neutral`, `border`, `ring`, `muted`, `shadow`) as 6- or 8-digit hex strings. | ||
| - `darkColors` — same shape as `colors`; applied automatically when the system is in dark mode. | ||
| - `design.borderRadius` — number, applied to both platforms. | ||
| - `design.fontFamily` — string, **iOS only**. | ||
|
|
||
| Theme JSON is validated at prebuild. On iOS the theme is embedded into `Info.plist`; on Android the JSON is copied into `android/app/src/main/assets/clerk_theme.json`. The plugin does not modify your app's `userInterfaceStyle` setting — control light/dark mode via `"userInterfaceStyle"` in `app.json`. |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.