Typesafe styled component utilities
npm install @codecademy/gamut-systemStyle props for building robustly typed design systems in react.
- Completely customizable style props (with theme agnostic implementation);
- Flexible props that are both responsive and composable.
- Strict design system aware types with no manual fuss.
- Works with emotion and styled-components in preferred syntax.
Checkout each section
- Getting Started
- Properties
- Responsive Properties
- Variants
- Customization
- Compose
Create your new system locally to your app:
``tsx
import { system, HandlerProps } from '@codecademy/gamut-system';
export const {
propGroups: { typography, spacing, layout },
} = system.create({});
export type TypographyProps = HandlerProps
export type SpacingProps = HandlerProps
export type LayoutProps = HandlerProps
`
In your components:
`tsx
import styled from '@emotion/styled';
import {
typography,
spacing,
layout,
TypographyProps,
SpacingProps,
LayoutProps,
} from '../system';
export type BoxProps = TypographyProps & SpacingProps & LayoutProps;
export const Box = styled
${typography}
${spacing}
${layout};`
`tsx
`
`tsx
// Array Syntax
// Object syntax
``