| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,6 @@ | |||
| 7 | 7 | ], | |
| 8 | 8 | "plugins": [ | |
| 9 | 9 | "babel-plugin-transform-object-rest-spread", | |
| 10 | - "babel-plugin-emotion", | ||
| 11 | 10 | ["babel-plugin-transform-runtime", { | |
| 12 | 11 | "polyfill": false | |
| 13 | 12 | }], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,13 +6,22 @@ | |||
| 6 | 6 | ||
| 7 | 7 | import { h as preact_h } from 'preact'; | |
| 8 | 8 | import { styled } from 'styletron-preact'; | |
| 9 | + import { css } from 'emotion'; | ||
| 9 | 10 | ||
| 10 | 11 | export default ( | |
| 11 | 12 | component: string, | |
| 12 | 13 | attributes: ?Object, | |
| 13 | 14 | ...children: Array<any> | |
| 14 | 15 | ) => { | |
| 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(); | ||
| 16 | 25 | ||
| 17 | 26 | return preact_h( | |
| 18 | 27 | style ? styled(component, style) : component, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments