web-cheat/emotion.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Emotion.js + React hello world. TODO</title>
<script src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="https://unpkg.com/@emotion/react@11.0.0-next.11/dist/react.umd.min.js"></script>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
/** @jsx jsx */
import { css, jsx } from '@emotion/react'
const style = css`
color: hotpink;
`
const SomeComponent = ({ children }) => (
<div css={style}>
Some hotpink text.
{children}
</div>
)
const anotherStyle = css({
textDecoration: 'underline'
})
const AnotherComponent = () => (
<div css={anotherStyle}>Some text with an underline.</div>
)
ReactDOM.render(
<SomeComponent>
<AnotherComponent />
</SomeComponent>,
document.getElementById('root')
);
</script>
</body>
</html>