@-ui/spacing 中文文档教程
@-ui/spacing
npm i @-ui/spacing
为设计系统创建间距比例
Quick Start
import styles from '@-ui/styles'
import * as spacing from '@-ui/spacing'
const variables = {
gap: {
sm: '0.5rem',
md: '1rem',
lg: '2rem',
},
pad: {
sm: '0.5rem',
md: '1rem',
lg: '2rem',
},
}
// Creates CSS variables for the scales (optional)
styles.variables(variables)
// Creates the scales
export const gap = spacing.gap(style, variables.gap)
export const pad = spacing.pad(style, variables.pad)
pad('sm')
API
LICENSE
使用 dash-ui MIT
@-ui/spacing
npm i @-ui/spacing
Create spacing scales for design systems with dash-ui
Quick Start
import styles from '@-ui/styles'
import * as spacing from '@-ui/spacing'
const variables = {
gap: {
sm: '0.5rem',
md: '1rem',
lg: '2rem',
},
pad: {
sm: '0.5rem',
md: '1rem',
lg: '2rem',
},
}
// Creates CSS variables for the scales (optional)
styles.variables(variables)
// Creates the scales
export const gap = spacing.gap(style, variables.gap)
export const pad = spacing.pad(style, variables.pad)
pad('sm')
API
LICENSE
MIT