makeSewp

This function sets up an instance of all the functions you’ll need to use Sewp. makeSewp takes a config with the following options:

{
    name: string, /* The name of your Sewp instance. */
    prefix: string, /* A prefix for classes generated by Sewp. */
    theme: object, /* An object of values that can be referenced in your styles. */
    aliases: object /* An object containing aliases for CSS properties. */
}

The theme object can be structured however you want as long as all the keys and values are strings or numbers.


Example Config

{
    name: 'Hot_Sewp',
    prefix: '🔥',
    theme: {
        navHeight: '5rem',
        colors: {
            primary: '#ff0000'
            secondary: '#dd1133',
        }
    },
    aliases: {
        p: 'padding',
        radius: 'borderRadius',
        m: 'margin',
    }
}

makeSewp outputs everything you need to use Sewp:

{
    name: string, /* The name of the instance. */
    prefix: string, /* The prefix for classes generated by Sewp. */
    makeTheme: function, /* Makes an additional theme */
    globalCss: function, /* Adds global styles  */
    css: function, /* Adds styles */
    extractCss: function, /* Outputs a string of all the styles */
    theme: object, /* An object  */
    themeStyles: string,
    parser: function,
}