Coding task · JavaScript and React course · Module 14: Advanced Styling

Practice: Component with Design Tokens

Create a tokens object with colors (primary, success, danger, background, surface, text) and spacing (sm, md, lg). Then create a tokensToVars() function that converts tokens to CSS Variables. Use them in a Card component that styles itself using var(--color-...) in CSS.

Task

Create a design tokens system and use it in a component