rsnext/examples/with-cxs/pages/index.tsx
Max Proske 07d3da102d
Convert with-cssed, with-csx, with-styled-jsx examples to TypeScript (#43018)
Updated 3 more examples to TypeScript. Changes to individual examples
pushed as separate commits.

- Swapped `cxs/lite` for `cxs`, as it's the only mode supported by
`@types/cxs`.

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-17 10:28:57 -08:00

29 lines
424 B
TypeScript

import cxs from 'cxs'
const cx = {
root: cxs({
width: 80,
height: 60,
background: 'white',
':hover': {
background: 'black',
},
}),
title: cxs({
marginLeft: 5,
color: 'black',
fontSize: 22,
':hover': {
color: 'white',
},
}),
}
export default function Home() {
return (
<div className={cx.root}>
<h1 className={cx.title}>My page</h1>
</div>
)
}