Responsive theme-based props

Introduction

All @deity/falcon-ui components accept responsive, theme-based style props which offer easy to use, flexible yet consistent styling customization.

Responsive, theme-based style props can be used inline on component:

or defined in theme:

All of @deity/falcon-ui components come with default theme which can be overridden as shown in the example above.



Responsive theme-based style props playground
Item1
Item2
Item3
Item4

Responsive notation

All of the responsive theme-based props work seamlessy with breakpoints defined in Theme.

Simply pass object as responsive prop value with its keys being breakpoints keys defined in Theme and values being property values to have responsive prop that changes based on screen width.

Breakpoint values defined in Theme get replaced with @media screen and (min-width :...) media query.

Responsive props!

Css prop

All @deity/falcon-ui components include css prop as an escape hatch for more complex and one-off styles. Css prop accepts CSS properties as an object literal or function with props param that has theme and returns CSS properties as an object literal.


Full reference of available props

PropertyMeaning(CSS property)Available Values
colorcolor
bgbackground-color
fillfill
strokestroke
borderColorborder-color
bgFullWidth
transform function

The margin and padding props use a shorthand syntax, similar to Tachyons, Basscss or Rebass approaches.

PropertyMeaning(CSS property)Available Values
mmargin
mtmargin-top
mlmargin-left
mrmargin-right
mbmargin-bottom
mx
transform function
my
transform function
ppadding
ptpadding-top
plpadding-left
prpadding-right
pbpadding-bottom
px
transform function
py
transform function
heightheight
widthwidth
size
transform function
gridGapgrid-gap
gridRowGapgrid-row-gap
gridColumnGapgrid-column-gap
PropertyMeaning(CSS property)Available Values
fontFamilyfont-family
fontSizefont-size
fontWeightfont-weight
letterSpacingletter-spacing
lineHeightline-height
PropertyMeaning(CSS property)Available Values
borderborder
borderTopborder-top
borderRightborder-right
borderBottomborder-bottom
borderLeftborder-left
borderRadiusborder-radius

Miscellaneous props

PropertyMeaning(CSS property)Available Values
boxShadowbox-shadow
transitionTimingFunctiontransition-timing-function
transitionDurationtransition-duration

Theme

Component

Presets

Download


Colors
Spacing
Typography
Breakpoints
Borders
Miscellaneous