Extends a Sx function with new configuration
import {extendSx} from 'muitils'// orimport {extendSx} from 'muitils/sx' Copy
import {extendSx} from 'muitils'// orimport {extendSx} from 'muitils/sx'
const rootSx = createSx({ classes: ['form', 'field'] as const, definitions:{ w100: {width:'100%'}, h100: {height:'100%'} } as const,})const sx = extendSx(rootSx,{ classes: ['input'] as const, definitions:{ input: { border: '1px solid red' } } as const,})const boxSx = sx({ ...sx.def('w100','input'), [sx.$('& .field')]: { p: 2 }})const form = ( <Box sx={boxSx}> <TextField className={sx.classes.field}/> </Box>) Copy
const rootSx = createSx({ classes: ['form', 'field'] as const, definitions:{ w100: {width:'100%'}, h100: {height:'100%'} } as const,})const sx = extendSx(rootSx,{ classes: ['input'] as const, definitions:{ input: { border: '1px solid red' } } as const,})const boxSx = sx({ ...sx.def('w100','input'), [sx.$('& .field')]: { p: 2 }})const form = ( <Box sx={boxSx}> <TextField className={sx.classes.field}/> </Box>)
Description
Extends a Sx function with new configuration
Importing
Example