diff --git a/packages/react/src/StyledProvider.tsx b/packages/react/src/StyledProvider.tsx index 3006403c..b8a50b7a 100644 --- a/packages/react/src/StyledProvider.tsx +++ b/packages/react/src/StyledProvider.tsx @@ -152,7 +152,7 @@ export const StyledProvider: React.FC<{ const [animationDriverData, setAnimationDriverData] = React.useState(); const globalStyleMap = - config?.globalStyle && createGlobalStyles(config.globalStyle); + config?.globalStyle && createGlobalStyles(config.globalStyle, Platform); const contextValue = React.useMemo(() => { const styledData = { diff --git a/packages/react/src/createGlobalStyles.ts b/packages/react/src/createGlobalStyles.ts index 30294efd..f072fd9e 100644 --- a/packages/react/src/createGlobalStyles.ts +++ b/packages/react/src/createGlobalStyles.ts @@ -1,9 +1,11 @@ import { convertStyledToStyledVerbosed } from './convertSxToSxVerbosed'; import { stableHash } from './stableHash'; +import { resolvePlatformTheme } from './styled'; import { updateOrderUnResolvedMap } from './updateOrderUnResolvedMap'; -export const createGlobalStyles = (globalStyle: object) => { +export const createGlobalStyles = (globalStyle: object, Platform) => { const versboseComponentTheme = convertStyledToStyledVerbosed(globalStyle); + resolvePlatformTheme(versboseComponentTheme, Platform.OS); const componentHash = stableHash({ ...globalStyle, }); diff --git a/yarn.lock b/yarn.lock index 5a435166..6344fb3d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2606,28 +2606,7 @@ "@babel/traverse" "^7.20.5" lodash.merge "^4.6.2" -"@gluestack-style/babel-plugin-styled-resolver@^0.1.6": - version "0.1.14" - resolved "https://registry.yarnpkg.com/@gluestack-style/babel-plugin-styled-resolver/-/babel-plugin-styled-resolver-0.1.14.tgz#1e3cd2dbdf91b5e9dcb8d34ab7df7aed1beea9bb" - integrity sha512-fgfuvCTngRZIbZf5prtoiZeOBaMtjEh4EJUIJygHY6iXscFuU6tnstnMnHqZdCd1dty+2E1DuwnG+JSKfYgYmA== - dependencies: - "@babel/core" "^7.20.5" - "@babel/generator" "^7.20.5" - "@babel/parser" "^7.20.5" - "@babel/plugin-transform-typescript" "^7.20.2" - "@babel/preset-typescript" "^7.18.6" - "@babel/traverse" "^7.20.5" - lodash.merge "^4.6.2" - -"@gluestack-style/react@^0.1.33": - version "0.1.33" - resolved "https://registry.yarnpkg.com/@gluestack-style/react/-/react-0.1.33.tgz#cd18f38bf359527e4f79d223bb07e9024f40ba4f" - integrity sha512-wBdoOA3i/cp0EcgJnwJgL1a8BATjbX/pCZgWm31N6sZOgCB4Phq7m0bDjfSpeJ8sKpOEDlUP5wYCo7Yww0mbqA== - dependencies: - inline-style-prefixer "^6.0.1" - normalize-css-color "^1.0.2" - -"@gluestack-style/react@^0.2.11-alpha.0", "@gluestack-style/react@^0.2.16", "@gluestack-style/react@^0.2.21", "@gluestack-style/react@^0.2.49": +"@gluestack-style/react@^0.2.16", "@gluestack-style/react@^0.2.21": version "0.2.51" resolved "https://registry.yarnpkg.com/@gluestack-style/react/-/react-0.2.51.tgz#0cfcca4f97f908ed3a352bd7e2336d436cc22415" integrity sha512-21TLr+e7KneP8N1d1iMKG6npMdYb/oPN/t5KZ/2kns2mg9NVCrfVmVuuMYKo+Xcej95BFOHuGuomskzLwdK1HQ==