import { flattenTokens } from '@uhg-abyss/mobile';Properties
flattenTokens(...themes: TokenTheme[])Usage
The flattenTokens function is designed to flatten and merge tokens from multiple JSON structures,
to support a layered system where tokens from different themes can override core, semantic, and component
level tokens.
The Abyss theme accepts an object with the following keys to define the theme:
sizing, spacing, color, borderRadius, borderWidth, boxShadow, fontFamilies, fontWeights,
fontSizes, lineHeights, letterSpacing, border, and opacity.
This function will return a single object in this format that can be used to create a theme object via createTheme for later use in the ThemeProvider.
Overriding Abyss Token Theme
In this example, we use flattenTokens and createTheme to create a new theme object, which is then passed
into ThemeProvider to override the Abyss theme and customize the Toast component.