Gathering detailed insights and metrics for antd-style
Gathering detailed insights and metrics for antd-style
Gathering detailed insights and metrics for antd-style
Gathering detailed insights and metrics for antd-style
npm install antd-style
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
229 Stars
579 Commits
35 Forks
1 Watching
3 Branches
47 Contributors
Updated on 28 Nov 2024
TypeScript (99.09%)
JavaScript (0.83%)
Shell (0.07%)
Cumulative downloads
Total Downloads
Last day
32.2%
17,017
Compared to previous day
Last week
23%
85,803
Compared to previous week
Last month
16.8%
285,895
Compared to previous month
Last year
807.3%
2,171,908
Compared to previous year
8
55
A business-level css-in-js
solution built on the Ant Design V5 Token System. It is based on emotion at the bottom.
It is recommended to install using pnpm
1pnpm i antd-style -S
1import { createStyles } from 'antd-style'; 2 3const useStyles = createStyles(({ token, css }) => ({ 4 // Supports the writing style of css object 5 container: { 6 backgroundColor: token.colorBgLayout, 7 borderRadius: token.borderRadiusLG, 8 maxWidth: 400, 9 width: '100%', 10 height: 180, 11 display: 'flex', 12 alignItems: 'center', 13 justifyContent: 'center', 14 flexDirection: 'column', 15 marginLeft: 'auto', 16 marginRight: 'auto', 17 }, 18 // Also supports obtaining the same writing experience as normal css through css string templates 19 card: css` 20 box-shadow: ${token.boxShadow}; 21 padding: ${token.padding}px; 22 border-radius: ${token.borderRadius}px; 23 color: ${token.colorTextTertiary}; 24 background: ${token.colorBgContainer}; 25 transition: all 100ms ${token.motionEaseInBack}; 26 27 margin-bottom: 8px; 28 cursor: pointer; 29 30 &:hover { 31 color: ${token.colorTextSecondary}; 32 box-shadow: ${token.boxShadowSecondary}; 33 } 34 `, 35})); 36 37export default () => { 38 // The styles object in the useStyles method is cached by default, so there is no need to worry about re-rendering issues 39 const { styles, cx, theme } = useStyles(); 40 41 return ( 42 // Use cx to organize className 43 <div className={cx('a-simple-create-style-demo-classname', styles.container)}> 44 <div className={styles.card}>createStyles Demo</div> 45 {/* The theme object contains all token and theme information */} 46 <div>Current theme mode: {theme.appearance}</div> 47 </div> 48 ); 49};
Details: CHANGELOG
No vulnerabilities found.
No security vulnerabilities found.