Styling

The Design System ships with a powerful styling engine called Fela

.
It provides several plugins to achieve common tasks such as vendor prefixing, fallback values and responsive values.

Extending Styles

Many core components take an

extend
prop that allows for style extension.
It accepts a style object or an array of style objects that can be consumed by fela.

Caution: Extending styles will overwrite passed style props.

El Component

If we want to style a new component with no base styles at all, we can leverage the El component. It accepts the

extend
prop and has no styles applied by default.

Responsive Values

We implement the theme-value

plugin to apply style values to specific breakpoints.
The default theme ships with the following breakpoints:

Hence the following markup will render CSS equivalent to the code below.

Properties

The following properties support responsive values:

  • padding
  • paddingLeft
  • paddingRight
  • paddingTop
  • paddingBottom
  • paddingVertical
  • paddingHorizontal
  • margin
  • marginLeft
  • marginRight
  • marginTop
  • marginBottom
  • marginVertical
  • marginHorizontal
  • width
  • height
  • minWidth
  • minHeight
  • maxWidth
  • maxHeight
  • flex
  • flexGrow
  • flexShrink
  • flexBasis
  • alignSelf
  • alignItems
  • alignContent
  • justifyContent
  • flexDirection
  • flexWrap
  • order
  • display
  • color
  • gridGap
  • gridTemplateColumns
  • gridTemplateRows
  • space