Last active
May 5, 2020 15:59
-
-
Save chaance/6b7837b1f6341eac740eed38d5b85c3e to your computer and use it in GitHub Desktop.
Overriding the default theme types in Emotion 11
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 goes in you root types directory, filename is the [name-of-your-module].d.ts | |
import '@emotion/react'; | |
import { MyCustomTheme } from './theme'; | |
declare module '@emotion/react' { | |
export interface Theme extends MyCustomTheme {} | |
} |
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
export type ThemeColorScheme = { | |
primary: string; | |
background: { | |
body: string; | |
}; | |
text: { | |
body: string; | |
}; | |
}; | |
export type MyCustomTheme = { | |
colors: ThemeColorScheme; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment