title | description | releaseUrl | releaseDate | version |
---|---|---|---|---|
Version 1.8.0 |
Explore the changelog for Chakra UI version 1.8.0. Learn about the latest features, bug fixes, and improvements. |
January 25, 2022 |
1.8.0 |
-
#5316
1537a725f
Thanks @TimKolberger! - Introducing semantic tokensSemantic tokens provide the ability to create css variables which can change with a CSS condition.
import { ChakraProvider, extendTheme } from "@chakra-ui/react" const customTheme = extendTheme({ colors: { 900: "#171923", }, }) const App = () => ( <ChakraProvider theme={customTheme}> <Text color="gray.900">will always be gray.900</Text> </ChakraProvider> )
import { ChakraProvider, extendTheme } from "@chakra-ui/react" const customTheme = extendTheme({ colors: { 50: "#F7FAFC", 900: "#171923", }, semanticTokens: { colors: { text: { default: "gray.900", _dark: "gray.50", }, }, }, }) const App = () => ( <ChakraProvider theme={customTheme}> <Text color="text"> will be gray.900 in light mode and gray.50 in dark mode </Text> </ChakraProvider> )
import { extendTheme } from "@chakra-ui/react" const theme = extendTheme({ colors: { red: { 100: "#ff0010", 400: "#ff0040", 500: "#ff0050", 700: "#ff0070", 800: "#ff0080", }, }, semanticTokens: { colors: { error: "red.500", // create a token alias success: "red.100", primary: { // set variable conditionally with pseudo selectors like `_dark` and `_light` // use `default` to define fallback value default: "red.500", _dark: "red.400", }, secondary: { default: "red.800", _dark: "red.700", }, }, }, })
- #5442
cbad002e7
Thanks @segunadebayo! - AdduseAnimationState
hook to help track motion component animations. Used in popopover and menu lazy modes
-
#5445
6e259a1f7
Thanks @rjokelai! - fix useConst types when using init function -
Updated dependencies [
1537a725f
]
- #4982
7a136f5a8
Thanks @segunadebayo! - Add support for customformat
,parse
and character validation callbacks.
- #4982
e4f5ee819
Thanks @segunadebayo! - Fix issue where number input doesn't leave the spinning state when inc/dec button is disabled - Updated dependencies
[
cbad002e7
,6e259a1f7
,1537a725f
]
1b31b374c
Thanks @segunadebayo! -
- Updated dependencies
[
7a136f5a8
,1537a725f
,4944a4a2b
,cbad002e7
,22171af7f
,cbad002e7
,6e259a1f7
,c393dd268
,787857861
,94c8be3cd
,1537a725f
,c9c54aee1
,5a845d5f5
,a5f3bfce8
,e4f5ee819
,da90855dd
]
-
#5316
1537a725f
Thanks @TimKolberger! - Introducing semantic tokensSemantic tokens provide the ability to create css variables which can change with a CSS condition.
import { ChakraProvider, extendTheme } from "@chakra-ui/react" const customTheme = extendTheme({ colors: { 900: "#171923", }, }) const App = () => ( <ChakraProvider theme={customTheme}> <Text color="gray.900">will always be gray.900</Text> </ChakraProvider> )
import { ChakraProvider, extendTheme } from "@chakra-ui/react" const customTheme = extendTheme({ colors: { 50: "#F7FAFC", 900: "#171923", }, semanticTokens: { colors: { text: { default: "gray.900", _dark: "gray.50", }, }, }, }) const App = () => ( <ChakraProvider theme={customTheme}> <Text color="text"> will be gray.900 in light mode and gray.50 in dark mode </Text> </ChakraProvider> )
import { extendTheme } from "@chakra-ui/react" const theme = extendTheme({ colors: { red: { 100: "#ff0010", 400: "#ff0040", 500: "#ff0050", 700: "#ff0070", 800: "#ff0080", }, }, semanticTokens: { colors: { error: "red.500", // create a token alias success: "red.100", primary: { // set variable conditionally with pseudo selectors like `_dark` and `_light` // use `default` to define fallback value default: "red.500", _dark: "red.400", }, secondary: { default: "red.800", _dark: "red.700", }, }, }, })
-
#5355
bb7eb18da
Thanks @TimKolberger! - Export TypeScript types ResponsiveObject and ResponsiveArray
-
#5359
3b4117781
Thanks @TimKolberger! - Updated the_placeholderShown
selector -
Updated dependencies [
1537a725f
]
- #5358
4944a4a2b
Thanks @TimKolberger! - Add React component<CSSVars root=":host, :root" />
to allow rehoisting CSS vars
- #5374
5a845d5f5
Thanks @TimKolberger! - Updated typeThemingProps
to allow string values for the propsvariant
andsize
even on components which are not in the default theme. - Updated dependencies
[
1537a725f
,1537a725f
,3b4117781
,bb7eb18da
]
-
#5316
1537a725f
Thanks @TimKolberger! - Introducing semantic tokensSemantic tokens provide the ability to create css variables which can change with a CSS condition.
import { ChakraProvider, extendTheme } from "@chakra-ui/react" const customTheme = extendTheme({ colors: { 900: "#171923", }, }) const App = () => ( <ChakraProvider theme={customTheme}> <Text color="gray.900">will always be gray.900</Text> </ChakraProvider> )
import { ChakraProvider, extendTheme } from "@chakra-ui/react" const customTheme = extendTheme({ colors: { 50: "#F7FAFC", 900: "#171923", }, semanticTokens: { colors: { text: { default: "gray.900", _dark: "gray.50", }, }, }, }) const App = () => ( <ChakraProvider theme={customTheme}> <Text color="text"> will be gray.900 in light mode and gray.50 in dark mode </Text> </ChakraProvider> )
import { extendTheme } from "@chakra-ui/react" const theme = extendTheme({ colors: { red: { 100: "#ff0010", 400: "#ff0040", 500: "#ff0050", 700: "#ff0070", 800: "#ff0080", }, }, semanticTokens: { colors: { error: "red.500", // create a token alias success: "red.100", primary: { // set variable conditionally with pseudo selectors like `_dark` and `_light` // use `default` to define fallback value default: "red.500", _dark: "red.400", }, secondary: { default: "red.800", _dark: "red.700", }, }, }, })
-
#5419
a5f3bfce8
Thanks @segunadebayo! - Add entrypoints to the different parts of the theme (colors, fonts, components, spacing, etc.)// Now you can use only colors from the theme import colors from "@chakra-ui/theme/foundations/colors"
Here's a table of the theme parts and entrypoints
Part Entrypoint components "@chakra-ui/theme/components"
foundations "@chakra-ui/theme/foundations"
colors "@chakra-ui/theme/foundations/colors"
sizes "@chakra-ui/theme/foundations/sizes"
spacing "@chakra-ui/theme/foundations/spacing"
typography "@chakra-ui/theme/foundations/typography"
radius "@chakra-ui/theme/foundations/radius"
shadows "@chakra-ui/theme/foundations/shadows"
transition "@chakra-ui/theme/foundations/transition"
zIndex "@chakra-ui/theme/foundations/z-index"
blur "@chakra-ui/theme/foundations/blur"
borders "@chakra-ui/theme/foundations/borders"
-
#5316
1537a725f
Thanks @TimKolberger! - Add helper functionflatten
import { flatten } from "@chakra-ui/utils" flatten({ space: [0, 1, 2, 4, 8, 16, 32] }) /** => { "space.0": 0, "space.1": 1, "space.2": 2, "space.3": 4, "space.4": 8, "space.5": 16, "space.6": 32, } */
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
-
#5355
94c8be3cd
Thanks @TimKolberger! - Fixed ThemingProps typings for ButtonGroup -
#5284
da90855dd
Thanks @marek-sed! - Fixed an issue where theiconSpacing
for the<ButtonSpinner />
was hardcoded.
- #5375
c9c54aee1
Thanks @noobinthisgame! - Added aCheckboxState
type to theuseCheckbox
hook to improve usability and documentation - Updated dependencies
[
cbad002e7
,6e259a1f7
,1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
-
#5355
22171af7f
Thanks @TimKolberger! - Update typings for useBreakpointValue parameter -
Updated dependencies [
1537a725f
]
- #5442
cbad002e7
Thanks @segunadebayo! - Fix issue where the content of a lazy popover or menu gets unmounted before (framer-motion) animation ends leading to a janky user experience. - Updated dependencies
[
cbad002e7
,6e259a1f7
,1537a725f
]
- #5442
cbad002e7
Thanks @segunadebayo! - Fix issue where the content of a lazy popover or menu gets unmounted before (framer-motion) animation ends leading to a janky user experience. - Updated dependencies
[
cbad002e7
,6e259a1f7
,1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
-
#5362
787857861
Thanks @sohamsshah! - fix a minor edge-case for calculating theindex
in use-range-slider
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
- #5241
ebf1d98be
Thanks @timonweber! - Allow style function types to be part ofStyleConfig
andMultiStyleConfig
types to reflect the possible usage of style functions instead of style objects. - Updated dependencies
[
1537a725f
]
- Updated dependencies
[
1537a725f
]
@chakra-ui/visually-hidden@1.1.2
- Updated dependencies
[
1537a725f
]
-
#5372
472612e7a
Thanks @selbekk! - Update README to reflect the change of the default--out
path tonode_modules/@chakra-ui/styled-system/dist/declarations/src/theming.types.d.ts
-
Updated dependencies [
1537a725f
]
- Updated dependencies
[
1b31b374c
]
- Updated dependencies
[
1b31b374c
]
- Updated dependencies
[
1b31b374c
]
- Updated dependencies
[
1b31b374c
]