Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ant-design/use-emotion-css
A gadget that combines emotion and antd token
https://github.com/ant-design/use-emotion-css
Last synced: about 2 months ago
JSON representation
A gadget that combines emotion and antd token
- Host: GitHub
- URL: https://github.com/ant-design/use-emotion-css
- Owner: ant-design
- Created: 2022-11-19T07:41:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-05T09:43:43.000Z (about 2 years ago)
- Last Synced: 2024-11-04T15:20:51.642Z (about 2 months ago)
- Language: TypeScript
- Size: 1.02 MB
- Stars: 16
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# use-emotion-css
A gadget that combines emotion and antd token
```jsx
import { useEmotionCss } from '@ant-design/use-emotion-css';
import React from 'react';export default () => {
const className = useEmotionCss(({ token }) => {
return {
color: token.colorPrimary,
display: 'flex',
justifyContent: 'center',
gap: 24,
padding: 24,
flexDirection: 'column',
};
});
const blockClassName = useEmotionCss(({ token }) => {
return {
backgroundColor: token.colorPrimary,
width: 12,
height: 12,
borderRadius: 12,
};
});
return (
Hello World
);
};
```