FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

manually handle emoition · devhttps/frontend@ceec985 · GitHub

Commit ceec985

Browse files
committed
manually handle emoition
1 parent 681e593 commit ceec985

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎ui/.babelrc‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
],
88
"plugins": [
99
"babel-plugin-transform-object-rest-spread",
10-
"babel-plugin-emotion",
1110
["babel-plugin-transform-runtime", {
1211
"polyfill": false
1312
}],

‎ui/src/utils/h.jsx‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66

77
import { h as preact_h } from 'preact';
88
import { styled } from 'styletron-preact';
9+
import { css } from 'emotion';
910

1011
export default (
1112
component: string,
1213
attributes: ?Object,
1314
...children: Array<any>
1415
) => {
15-
const { style, ...otherAttributes } = attributes || {};
16+
const { style, expensiveCSS, ...otherAttributes } = attributes || {};
17+
18+
if (typeof expensiveCSS !== 'undefined' && Object.keys(expensiveCSS).length)
19+
otherAttributes.className = [
20+
css(expensiveCSS),
21+
otherAttributes.className,
22+
]
23+
.join(' ')
24+
.trim();
1625

1726
return preact_h(
1827
style ? styled(component, style) : component,

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL