* introduce tokens file + theme type * fix lint error * TRCL-3497 Use color tokens in app + tradingView widget (#240) * update to use tokens, small fixes * fix eol lint * move usage style helper to lib/styles * move files, fix text colors * fix logo in light mode * remove colors.css file * small lint things * add transparency to button + destructive borders
21 lines
495 B
TypeScript
21 lines
495 B
TypeScript
import { css } from 'styled-components';
|
|
|
|
import { type RiskLevels } from '@/constants/abacus';
|
|
|
|
export const UsageColorFromRiskLevel = (riskLevel: RiskLevels) =>
|
|
({
|
|
low: css`
|
|
color: var(--color-risk-low);
|
|
`,
|
|
medium: css`
|
|
color: var(--color-risk-medium);
|
|
`,
|
|
high: css`
|
|
color: var(--color-risk-high);
|
|
`,
|
|
}[riskLevel.name]);
|
|
|
|
export const generateFadedColorVariant = (colorHex: string, opacityHex: string) => {
|
|
return `${colorHex}${opacityHex}`;
|
|
};
|