Minor Changes
-
773497896
#3997 Thanks
@segunadebayo! - Ring stylesAdded ring style props to make it easier to style an element's focus ring
shadows. Props arering
,ringColor
,ringOffset
, andringOffsetColor
.// adds a 2px box-shadow with `gray.400` color <Box ring="2px" ringColor="gray.400"> Sample </Box> // adds main box-shadow + offset box-shadow <Box ring="2px" ringColor="gray.400" ringOffset="3px" ringOffsetColor="white"> Sample </Box>
Filter styles
Added css variable based API to apply css filter properties (blur,
backdrop-blur) to an element. Props arefilter
,blur
,sepia
,
brightness
,invert
,saturation
,backdropFilter
,backdropBlur
,
sepia
,saturation
, etc.To use this API, you'll need to set
filter
toauto
, same for
backdropFilter
.// adds a 3px blur filter to this element <Image src="boruto.png" filter="auto" blur="3px" /> // adds a 3px blur and 40% saturation filter to this element <Image src="boruto.png" filter="auto" blur="3px" saturation={0.4} />
Transform styles
Added css variable based API to apply css transform properties (translateX,
translateY, scale, etc.). Props aretranslateX
,translateY
,rotate
,
scaleX
,scaleY
, andscale
.To use this API, you'll need to set
transform
toauto
orauto-gpu
(for
the GPU accelerated version).<Circle transform="auto" translateX="4" _hover={{ translateX: "8" }}> <CheckIcon /> </Circle>
-
Add
mixBlendMode
,backgroundBlendMode
, andbgBlendMode
props to apply
blend modes to elements -
Automatic wrapping of
backgroundImage
orbgImage
props withurl()
so
you can just pass the image URL directly.
// You can now do this! <Box bgImage="naruto.png" /> // This still works <Box bgImage="url(naruto.png)" />
-
text decoration styles: Added
textDecorationColor
,textDecorationLine
,
textDecorationStyles
style props. -
Add
isolation
style prop to create a new stacking context.
High Contrast Mode
Fixed issue where setting
outline:0
oroutline:none
and usingbox-shadow
for focus outlines don't work in high-contrast mode.To fix this, we've added
outline: 2px solid transparent
whenever you set
outline:0
to make your components work in high-constrast mode by default.-
Fix the
_dark
pseudo props to map to
.chakra-ui-dark &, [data-theme=dark] &, &[data-theme=dark]
. -
Added
_light
pseudo props to map to
.chakra-ui-light &, [data-theme=light] &, &[data-theme=light]
for users
that prefer to start with dark mode. -
Added
overscroll
,overscrollX
, andoverscrollY
style prop to manage
overscroll behavior of an container
-