-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make mode an optional property on any theme provided to CodeBlock
- Loading branch information
1 parent
fae8f1a
commit 072f5f5
Showing
3 changed files
with
9 additions
and
4 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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { ThemeProps, Theme } from 'types'; | ||
import { ThemeProps, ModeSafeTheme } from 'types'; | ||
|
||
const DEFAULT_THEME_MODE = 'light'; | ||
|
||
// Resolves the different types of theme objects in the current API | ||
export default function getTheme(props?: ThemeProps): Theme { | ||
export default function getTheme(props?: ThemeProps): ModeSafeTheme { | ||
// If format not supported (or no theme provided), return standard theme | ||
return { mode: DEFAULT_THEME_MODE, ...props?.theme }; | ||
return { mode: DEFAULT_THEME_MODE, ...props?.theme } as ModeSafeTheme; | ||
} |
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