Skip to content

Commit

Permalink
fix: variant and macro types
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Apr 13, 2023
1 parent 079b468 commit d0bca91
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .changeset/gorgeous-plums-tan.md
@@ -0,0 +1,6 @@
---
"@svbstrate/react-native": patch
"@svbstrate/core": patch
---

Fix variant and macro types
6 changes: 3 additions & 3 deletions packages/core/lib/types.ts
Expand Up @@ -116,7 +116,9 @@ export type SvbstrateCSSStyleObject = {
paddingLeft?: MapShorthandToToken<"paddingLeft", "space">;
paddingRight?: MapShorthandToToken<"paddingRight", "space">;
} & Partial<Shorthands> &
Partial<CustomProperties>;
Partial<CustomProperties> &
Partial<Macros> &
Partial<Variants>;

export type SvbstratePsuedoStyleObject = {
// psuedo selector blocks
Expand All @@ -135,8 +137,6 @@ export type SvbstrateMiscStyleObject = {
export type SvbstrateStyleObject = SvbstrateCSSStyleObject &
SvbstratePsuedoStyleObject &
SvbstrateHTMLStyleObject &
Partial<Macros> &
Partial<Variants> &
SvbstrateMiscStyleObject;

export interface ThemeConfig {
Expand Down
9 changes: 6 additions & 3 deletions packages/react-native/lib/__tests__/test
Expand Up @@ -27,12 +27,15 @@ function App() {
space: [],
},
variants: {
shadow(value, theme) {
return value
shadow: {
large: {
},
small: {
},
}
}
}}>
<Box as={Box}>Hello</Box>
<Box as={Box} color='primary' shadow='large'>Hello</Box>
</ThemeProvider>
</>
)
Expand Down

0 comments on commit d0bca91

Please sign in to comment.