4.0.0 • Published 4 years ago

@tpdewolf/styled-primitives v4.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Styled Primitives

This library is basicly a implementation of jxnblk's styled-system and very similar to rebassjs, but with typescript types built in, an added grid system and without the Img, Link and Button components.

Configuration

Your styled components theme needs a breakpoints and a grid property:

export const theme: DefaultTheme = {
  breakpoints: ['40em', '52em', '64em', '80em'],
  grid: {
    gutter: [15, null, 30], // responsive styles based on your breakpoints
    container: {
      maxWidth: 1280,
      padding: [15, null, 30],
    },
  },
}

Usage

Read the documentation from rebass for more information about the Box, Flex, Card, Text and Heading component.

The grid has 3 components: Contain, Row and Column. Example of grid:

<Contain>
  <Row>
    <Column col={4}>First column</Column>
    <Column col={4}>Second column</Column>
    <Column col={4}>Third column</Column>
  </Row>

  <Row gutter={40}>
    <Column col={[12, null, 6]}>
      With gutter overwrite and responsive styles
    </Column>
    <Column col={[12, null, 6]}>
      I'm 12 columns on mobile and 6 columns on laptop
    </Column>
  </Row>
</Contain>
4.0.0

4 years ago

4.0.0-0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

3.0.0-1

4 years ago

3.0.0-0

4 years ago

2.1.0

4 years ago

2.1.0-2

4 years ago

2.1.0-1

4 years ago

2.1.0-0

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.2-0

5 years ago

2.0.1

5 years ago

2.0.0-3

5 years ago

2.0.0-2

5 years ago

2.0.0-1

5 years ago

2.0.0-0

5 years ago

2.0.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago