Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenh committed Nov 14, 2022
1 parent 0e29072 commit 1be91be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion packages/app-tachyons-fela-prop/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function App() {
const [count, setCount] = useState(0);
return (
<div>
<h1 css={Css.lightGray.$}>Vite + React</h1>
<h1 css={Css.black.$}>Vite + React</h1>
<h1 style={Css.black.$}>Vite + React</h1>
<div>
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
</div>
Expand Down
16 changes: 6 additions & 10 deletions packages/app-tachyons-fela-prop/src/jsx-dev-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ export function jsxDEV(type, props = {}, ...children) {
if (props) {
const { css, className, ...otherProps } = props;
if (css) {
// Convert `{ color: "blue" }` --> `a`
const cn = renderer.renderRule(() => css, {});
return _jsxDEV(
type,
{
...otherProps,
className: className ? cn + " " + className : cn,
},
...children,
);
// Use emotion to convert `{ color: "blue" }` --> `a`
// const cn = renderer.renderRule(() => css, {});
// return _jsxDEV(type, { ...otherProps, className: className ? cn + " " + className : cn }, ...children);

// Or just use `style`
return _jsxDEV(type, { ...otherProps, style: css }, ...children);
}
}
return _jsxDEV(type, props, ...children);
Expand Down

0 comments on commit 1be91be

Please sign in to comment.