v2.0.0
What's new
- More utilities for CSS properties
- Uses verbose naming convention for
textAlign,alignItems,justifyContent,flexWrap, and other CSS properties style,responsiveStyle, andpseudoStyleutilities now acceptgetterandgettersarguments for converting values- New
bordersutility that normalizes the API with other styled-system utilities - Rewritten with ES module syntax
- DRYer code base for utilities like
fontSize,width, andcolor - The repo has been reorganized as a monorepo
Breaking
- The
cleanElementutility is now a separate package, removing thereactdependency from the core library - The
flexWraputility now expects a string value for its prop (previously a boolean) - The
borderWidthutility has been replaced with thebordersutility - The
borderTop,borderRight,borderBottom, andborderLeftprops no longer accept boolean props, but follow the same convention as other utilities - The default spacing scale has changed to
[ 0, 4, 8, 16, 32, 64, 128, 256, 512 ](this only affects usage without a customtheme.spaceprovided - Number values for breakpoints are now converted to px instead of ems to better match the rest of the library
- The
themeutility has been renamed tothemeGet(alternative names under consideration) - Removes
removePropsutility - Removes
idxutility - Removes legacy
responsiveStylearguments API - The
pseudoStylearguments API has changed to more closely align withstyleandresponsiveStyle
Shims for breaking changes
To make migration easier, some breaking changes will continue to work as intended or similarly:
justifyContentis aliased to thejustifyproptextAlignis aliased to thealignprop, though this may cause unexpected behavior when used with thealignItemspropalignItemsis aliased to thealignprop, though this may cause unexpected behavior when used with thetextAlignpropflexWrapis aliased to thewrapprop, but a string value ofwrapornowrapshould be provided. (a shim to convert booleantruevalues towraphas been added as well)borderWidthnow works similarly to the newbordersutility, which will continue to work for most use-cases- The
themeGetutility is aliased to athemeexport
New utilities
- fontFamily
- display
- minWidth
- height
- maxHeight
- minHeight
- size (width & height)
- alignContent
- order
- borders
- backgroundImage
- backgroundSize
- backgroundPosition
- zIndex
- top
- right
- bottom
- left