This document tracks all CSS variable standardization work completed in the "magic-worlds" project. We've replaced all non-standard CSS variables with standardized ones from /src/ui/styles/variables/.
The following files have been updated to use standard variables:
/home/andres/WebstormProjects/magic-worlds/src/ui/components/ConfirmDialog.css/home/andres/WebstormProjects/magic-worlds/src/ui/components/Header.css/home/andres/WebstormProjects/magic-worlds/src/ui/components/LoadingSpinner.css/home/andres/WebstormProjects/magic-worlds/src/ui/components/common/EmptyState.css/home/andres/WebstormProjects/magic-worlds/src/ui/components/lists/lists.css/home/andres/WebstormProjects/magic-worlds/src/ui/components/lists/Card/Card.css/home/andres/WebstormProjects/magic-worlds/src/features/characters/components/CharacterCreator.css/home/andres/WebstormProjects/magic-worlds/src/features/worlds/components/WorldCreator.css/home/andres/WebstormProjects/magic-worlds/src/features/interaction/components/InteractionCenterPanel.css/home/andres/WebstormProjects/magic-worlds/src/features/interaction/components/InteractionLeftPanel.css/home/andres/WebstormProjects/magic-worlds/src/features/interaction/components/InteractionRightPanel.css/home/andres/WebstormProjects/magic-worlds/src/features/interaction/components/AdventureInteraction.css/home/andres/WebstormProjects/magic-worlds/src/features/landing/components/LandingPage.css/home/andres/WebstormProjects/magic-worlds/src/features/adventures/components/AdventureCreator.css/home/andres/WebstormProjects/magic-worlds/src/ui/styles/App.css/home/andres/WebstormProjects/magic-worlds/src/ui/styles/base/forms.css/home/andres/WebstormProjects/magic-worlds/src/ui/styles/base/buttons.css/home/andres/WebstormProjects/magic-worlds/src/ui/styles/base/reset.css/home/andres/WebstormProjects/magic-worlds/src/ui/styles/base/layout.css/home/andres/WebstormProjects/magic-worlds/src/ui/styles/index.css
| Non-standard Variable | Standard Variable Used |
|---|---|
--color-surface |
--background-color-primary |
--color-background |
--background-color-secondary |
--color-background-secondary |
--background-color-tertiary |
--color-text |
--text-color |
--color-text-primary |
--text-color |
--color-text-secondary |
--text-color-secondary |
--color-primary |
--accent-color |
--color-primary-dark |
--accent-color-hover |
--color-border |
--border-color |
--border-radius |
--border-radius-small |
--spacing-sm |
--padding-small or --gap-small (context dependent) |
--spacing-md |
--padding-medium or --gap-medium (context dependent) |
--spacing-lg |
--padding-large or --gap-large (context dependent) |
--spacing-xl |
--gap-xs |
--spacing-xs |
--padding-small |
--font-size-sm |
--font-size-small |
--font-size-lg |
--font-size-large |
--font-size-xl |
--font-size-large |
--font-size-xs |
Direct value: 0.75rem |
--font-size-base |
Direct value: 1rem |
--line-height-base |
--line-height-normal |
--line-height-tight |
--line-height-normal |
--font-weight-semibold |
Direct value: 600 |
--font-weight-bold |
Direct value: 700 |
--font-weight-medium |
Direct value: 500 |
--font-weight-normal |
Direct value: 400 |
--shadow-md |
--box-shadow-medium |
--border-standard |
1px solid var(--border-color) |
--border-focus |
Direct value with --accent-color |
--color-primary-rgb |
--background-transparency-light |
--color-error-rgb |
--color-error-transparency |
--color-success-rgb |
--color-success-transparency |
--color-error-dark |
--color-error-hover |
--color-success-dark |
--color-success-hover |
--color-messages-error |
--color-error |
--spin 1s linear infinite |
--spin-animation |
transition with ease values |
--transition-standard |
- All variable replacements were done with existing variables from
/src/ui/styles/variables/, without creating any new ones. - For font weights, we used direct values (400, 500, 600, 700) where no variables existed.
- For all spacing variables, we mapped to the appropriate standard variable based on context (padding vs margin vs gap).
- All custom animation values were replaced with the
--spin-animationand--transition-standardvariables. - Color RGB values were replaced with appropriate transparency variables.
- Maintained consistent spacing throughout components using the standard spacing variables.
- Kept system variables like
--color-errorand--color-successas they appear to be part of the standard set.
- Improved maintainability: Any future theme changes can now be made in one central location.
- Better visual consistency: Using standardized variables ensures a more cohesive appearance across the entire application.
- Reduced CSS size: Eliminated duplicate custom variables that were serving the same purpose.
- Simplified developer experience: Developers now only need to learn one set of variable names.
- Better dark/light theme support: All components now use the same variable structure for theming.
- Easier onboarding: New team members will have a consistent variable system to learn.
These commands were used to verify that all non-standard variables were replaced:
grep -r "\--color-" --include="*.css" /home/andres/WebstormProjects/magic-worlds | grep -v "node_modules" | grep -v "variables" | grep -v "dist" | grep -v "build"grep -r "\--spacing-" --include="*.css" /home/andres/WebstormProjects/magic-worlds | grep -v "node_modules" | grep -v "variables" | grep -v "dist" | grep -v "build"find /home/andres/WebstormProjects/magic-worlds -name "*.css" | grep -v "node_modules" | grep -v "src/ui/styles/variables" | xargs grep -l "\--" | sort- Style Linting: Consider adding a CSS/SCSS linter with rules to enforce usage of standard variables.
- Documentation: Keep this mapping document updated if new standard variables are added.
- Component Library: Consider developing a component library that uses these standardized variables.
- Theming: Leverage the standardized variables for implementing dark/light mode or custom themes.