feat(platform): sprint 11.5 standardization
Some checks failed
Architecture Governance / architecture (push) Has been cancelled

This commit is contained in:
sdarbinyan
2026-07-09 02:29:12 +04:00
parent a16c856537
commit 8d652c8259
57 changed files with 2162 additions and 848 deletions

View File

@@ -3,6 +3,18 @@ import { ThemeCssVariables } from '../tokens/theme-css-variable.model';
import { THEME_VARIABLE_MAP } from '../tokens/theme-variable-map';
export function mapThemeConfigToCssVariables(theme: ThemeConfig): ThemeCssVariables {
const spacingScale = Array.isArray(theme.spacing.scale) && theme.spacing.scale.length > 0
? theme.spacing.scale
: [0.25, 0.5, 1, 1.5, 2];
const spacingValues = spacingScale
.slice(0, 5)
.map(multiplier => `${Math.max(0, Number(multiplier) || 0) * theme.spacing.unit}px`);
while (spacingValues.length < 5) {
spacingValues.push(`${theme.spacing.unit}px`);
}
const vars: ThemeCssVariables = {
[THEME_VARIABLE_MAP.primary]: theme.palette.primary,
[THEME_VARIABLE_MAP.secondary]: theme.palette.secondary,
@@ -16,6 +28,14 @@ export function mapThemeConfigToCssVariables(theme: ThemeConfig): ThemeCssVariab
[THEME_VARIABLE_MAP.backgroundPrimary]: theme.palette.backgroundPrimary,
[THEME_VARIABLE_MAP.backgroundSecondary]: theme.palette.backgroundSecondary,
[THEME_VARIABLE_MAP.border]: theme.palette.border,
[THEME_VARIABLE_MAP.spaceXs]: spacingValues[0],
[THEME_VARIABLE_MAP.spaceSm]: spacingValues[1],
[THEME_VARIABLE_MAP.spaceMd]: spacingValues[2],
[THEME_VARIABLE_MAP.spaceLg]: spacingValues[3],
[THEME_VARIABLE_MAP.spaceXl]: spacingValues[4],
[THEME_VARIABLE_MAP.transitionFast]: '120ms ease',
[THEME_VARIABLE_MAP.transitionNormal]: '180ms ease',
[THEME_VARIABLE_MAP.transitionSlow]: '300ms ease',
'--app-font-family': theme.typography.primaryFontFamily,
'--app-font-size': `${theme.typography.baseFontSize}px`,
'--app-spacing-unit': `${theme.spacing.unit}px`

View File

@@ -10,5 +10,13 @@ export const THEME_VARIABLE_MAP = {
textSecondary: '--text-secondary',
backgroundPrimary: '--bg-primary',
backgroundSecondary: '--bg-secondary',
border: '--border-color'
border: '--border-color',
spaceXs: '--space-xs',
spaceSm: '--space-sm',
spaceMd: '--space-md',
spaceLg: '--space-lg',
spaceXl: '--space-xl',
transitionFast: '--transition-fast',
transitionNormal: '--transition-normal',
transitionSlow: '--transition-slow'
} as const;