1.0.5 • Published 4 years ago

@superlogica/themeprovider v1.0.5

Weekly downloads
26
License
ISC
Repository
-
Last release
4 years ago

COMPONENT THEME PROVIDER

Esse package contém o componente theme provider da Superlógica para web/desktop, seguindo nossos Tokens e padrões.

Instalação:

npm install @superlogica/themeprovider

Props

A props theme é obrigatória, ela é responsável por atribuir valores aos componentes que dependem de tema

PropsTypeDefaultDescription
themeobjectnonedeve conter um objeto com os parametros padrões de tamanho, cor, padding, margins, etc... para os componentes
childrennodenonedeve conter toda sua aplicação que seja dependente do tema

Uso

import ThemeProvider from '@superlogica/ThemeProvider';
const Theme = {
    margin: {
        none: 0 + 'px',
        xxxs: paddingColumn/4 + 'px',
        xxs: paddingColumn/2 + 'px',
        xs: paddingColumn + 'px',
        sm: paddingColumn + (paddingColumn / 2) + 'px',
        md: gutterSize + 'px',
        lg: gutterSize + (paddingColumn / 2) + 'px',
        xl: gutterSize + paddingColumn,
        xxl: gutterSize * 2 + 'px',
        xxxl: (gutterSize * 2) + paddingColumn + 'px',
    },
    polished: {
        max: 1168,
        min: 320
    },
    heading: {
        h1: {
            label: {
                fontSize: 16,
                lineHeight: 20
            },
            max: {
                fontSize: 54,
                lineHeight: 62
            },
            min: {
                fontSize: 32,
                lineHeight: 36
            }
        },
        h2: {
            label: {
                fontSize: 16,
                lineHeight: 20
            },
            max: {
                fontSize: 36,
                lineHeight: 48,
            },
            min: {
                fontSize: 24,
                lineHeight: 36,
            }
        },
        h3: {
            label: {
                fontSize: 16,
                lineHeight: 20
            },
            max: {
                fontSize: 18,
                lineHeight: 24,
            },
            min: {
                fontSize: 16,
                lineHeight: 24,
            }
        },
        h4: {
            label: {
                fontSize: 16,
                lineHeight: 20
            },
            max: {
                fontSize: 18,
                lineHeight: 28,
            },
            min: {
                fontSize: 16,
                lineHeight: 24,
            }
        },
        h5: {
            label: {
                fontSize: 16,
                lineHeight: 20
            },
            max: {
                fontSize: 18,
                lineHeight: 28,
            },
            min: {
                fontSize: 16,
                lineHeight: 24,
            }
        },
        h6: {
            label: {
                fontSize: 16,
                lineHeight: 20
            },
            max: {
                fontSize: 16,
                lineHeight: 24,
            },
            min: {
                fontSize: 16,
                lineHeight: 24,
            }
        }
    }
}

function exemploThemeProvider () {
    ...
        return (
            <ThemeProvider theme={Theme}>
                //Sua aplicação
            </ThemeProvider>
        )
    ...
}

License

MIT

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.42

5 years ago

0.0.41

5 years ago

0.0.40

5 years ago

0.0.39

5 years ago

0.0.37

5 years ago

0.0.36

5 years ago

0.0.34

5 years ago

0.0.31

5 years ago

0.0.33

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.20

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.13

6 years ago

0.0.14

6 years ago

0.0.15

6 years ago

0.0.16

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago