-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor TS types to use builtin Theme interface which can be augment…
…ed by consumers (#1609) * Updated types to support global Theme definition * Updated documentation to reflect new theme typings * Simplified MuiTheme import syntax in docs * Use previous theme declaration in docs - [side-effect] Updated back to 2 space indentation * Update Button.tsx import declaration for styled * Updated type definitions to default to any if not defined * Quick pass at removing theme generic param * Fixed issue with Global * Fixed most of the test issues - Added TODO for one possible issue * Updated global Theme type declaration to module specific * Removed exports from test files * Use the incomplete theme prop testcase - Add test case for fully overriding theme * Added note about where styled tests get their theme declaration from * tweak docs * Remove InterpolationWithTheme type * Move adding Theme to Styled interpolations inline (and not as part of StyleProps) * Cleanup Interpolation-related types * Add changeset
- Loading branch information
1 parent
0b7ebdf
commit c643107
Showing
15 changed files
with
185 additions
and
240 deletions.
There are no files selected for viewing
This file contains 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,15 @@ | ||
--- | ||
'@emotion/core': major | ||
'@emotion/styled': major | ||
--- | ||
|
||
Reworked TypeScript definitions so it's easier to provide a type for Theme. Instead of creating custom instances (like before) you can augment builtin Theme interface like this: | ||
|
||
```ts | ||
declare module '@emotion/core' { | ||
export interface Theme { | ||
primaryColor: string | ||
secondaryColor: string | ||
} | ||
} | ||
``` |
This file contains 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,5 @@ | ||
--- | ||
'@emotion/serialize': minor | ||
--- | ||
|
||
Reworked Interpolation-related types. Correct types should now be provided to all flavours of emotion. |
This file contains 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 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 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 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.