grid-pro.agthemetokenmapcss
Home > @genesislcap/grid-pro > agThemeTokenMapCSS
agThemeTokenMapCSS() function
Generates the CSS for a given GridPro theme name and token map
Signature:
agThemeTokenMapCSS: (themeName: string, tokenMap: CSSVarTokenMap<any>) => import("@microsoft/fast-element").ElementStyles
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
themeName |
string |
the GridPro theme name |
|
tokenMap |
CSSVarTokenMap<any> |
a map of CSS variables AgGridCSSVars and custom token values |
Returns:
import("@microsoft/fast-element").ElementStyles
the CSS for the Grid Pro token map
Example
export const agThemeGenesisRapidTokens = {
backgroundColor: create<Swatch>('rapid-ag-background-color').withDefault((elem: HTMLElement) =>
baseLayerLuminance.getValueFor(elem) === StandardLuminance.LightMode
? lightColors.backgroundSwatch
: darkColors.backgroundSwatch
),
foregroundColor: create<Swatch>('rapid-ag-foreground-color').withDefault((elem: HTMLElement) =>
baseLayerLuminance.getValueFor(elem) === StandardLuminance.LightMode
? lightColors.foregroundSwatch
: darkColors.foregroundSwatch
),
};
export const agThemeGenesisRapidTokenMap: CSSVarTokenMap<AgGridCSSVars | string> = {
[AgGridCSSVars.backgroundColor]: agThemeGenesisRapidTokens.backgroundColor,
[AgGridCSSVars.foregroundColor]: agThemeGenesisRapidTokens.foregroundColor,
};