Question · JavaScript and React course · Module 14: Advanced Styling

Semantic vs Base Colors

Why is it worth separating semantic colors (primary, danger) from base colors (blue-500, red-400) in a design tokens system?

Answer options

  • Changing the theme only requires updating the semantic mapping, not searching through the entire codebase
  • Base colors are rendered faster by the browser
  • Semantic colors only work in CSS-in-JS
  • Base colors are required by the W3C specification

You can check the correct answer by solving this task in the CodeWorlds game.