Skip to content

Commit 5121672

Browse files
committed
Check if style has theme key when merging
1 parent d36f901 commit 5121672

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/themr.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
9898

9999
export function themeable(style = {}, theme) {
100100
if (!theme) return style
101-
return Object.keys(theme).reduce((result, key) =>
102-
({ ...result, [key]: `${style[key]} ${theme[key]}` }), style)
101+
return Object.keys(theme).reduce((result, key) => ({
102+
...result, [key]: style[key] ? `${style[key]} ${theme[key]}` : theme[key]
103+
}), style)
103104
}
104105

105106
function validateComposeOption(composeTheme) {

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { default as ThemeProvider } from './components/ThemeProvider'
22
export { default as themr } from './components/themr'
3+
export { themeable } from './components/themr'

0 commit comments

Comments
 (0)