Skip to content

Commit f489a4e

Browse files
Merge pull request #336 from FormidableLabs/bug/theme-application
Fix: Apply theme changes.
2 parents f0358f5 + 79d992a commit f489a4e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/Editor/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const CodeEditor = (props) => {
4141
getLineProps,
4242
getTokenProps,
4343
style: _style,
44+
theme: _theme,
4445
}) => (
4546
<pre
4647
className={_className}
@@ -49,7 +50,10 @@ const CodeEditor = (props) => {
4950
outline: "none",
5051
padding: 10,
5152
fontFamily: "inherit",
52-
...(!props.className || !props.theme ? {} : _style),
53+
...(_theme && typeof _theme.plain === "object"
54+
? _theme.plain
55+
: {}),
56+
..._style,
5357
}}
5458
ref={editorRef}
5559
spellCheck="false"

stories/Live.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ export const Default = DefaultTemplate.bind({});
226226
Default.args = {
227227
...defaultControls,
228228
code: code,
229+
theme: theme,
229230
};
230231

231232
export const FunctionExample = StyledPreviewTemplate.bind({});

0 commit comments

Comments
 (0)