styled-components v5.0.0 Release Notes
Release Date: 2019-07-01 // over 4 years ago-
๐ Read the v5 release announcement!
- 19% smaller bundle size
- 18% faster client-side mounting
- ๐ 17% faster updating of dynamic styles
- 45% faster server-side rendering
- ๐ RTL support
๐ NOTE: At this time we recommend not using
@import
inside ofcreateGlobalStyle
. We're working on better behavior for this functionality but it just doesn't really work at the moment and it's better if you just embed these imports in your HTML index file, etc.๐
StyleSheetManager
enhancements- you can now supply stylis plugins like stylis-plugin-rtl;
<StyleSheetManager stylisPlugins={[]}>...</StyleSheetManager>
disableVendorPrefixes
removes autoprefixing if you don't need legacy browser support;<StyleSheetManager disableVendorPrefixes>...</StyleSheetManager>
disableCSSOMInjection
forces using the slower injection mode if other integrations in your runtime environment can't parse CSSOM-injected styles;<StyleSheetManager disableCSSOMInjection>...</StyleSheetManager>
- you can now supply stylis plugins like stylis-plugin-rtl;
โ Remove deprecated attrs "subfunction" syntax variant
styled.div.attrs({ color: p => p.color });
should become
styled.div.attrs(p => ({ color: p.color }));
You can still pass objects to
attrs
but individual properties shouldn't have functions that receive props anymore.๐ Fix attrs not taking precedence over props when overriding a given prop
๐ (ReactNative) upgrade css-to-react-native to v3 (changelog)
- Removed support for unitless line height in font shorthand
๐ Replace
merge-anything
withmixin-deep
to save some bytes (this is what handles merging ofdefaultProps
between folded styled components); this is inlined into since the library is written in IE-incompatible syntax๐ Fix certain adblockers messing up styling by purposefully not emitting the substring "ad" (case-insensitive) when generating dynamic class names
๐ Fix regressed behavior between v3 and v4 where className was not correctly aggregated between folded
.attrs
invocations๐ Fix support for styling custom elements (https://github.com/styled-components/styled-components/pull/2819)