Function createSx

  • Type Parameters

    • Config extends Partial<SxConfig<object>>

    Parameters

    Returns Sx<SxConfig<Config>>

    Creates a Sx function with extensions

    import {createSx} from 'muitils'
    // or
    import {createSx} from 'muitils/sx'




    const sx = createSx({
    classes: ['section','container'] as const,
    definitions:{
    w100: {width:'100%'},
    h100: {height:'100%'}
    } as const,
    });

    const boxSx = sx({
    ...sx.def('w100','h100'),
    [sx.$('& .section')]: {
    p: 2
    }
    })

    const box = <Box sx={boxSx} />