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

Main Advantage of Zero-runtime CSS-in-JS

What is the main advantage of zero-runtime CSS-in-JS (e.g., vanilla-extract) over runtime CSS-in-JS (e.g., styled-components)?

Answer options

  • No additional JavaScript in the bundle -- styles are in a CSS file, resulting in a smaller bundle and faster rendering
  • Easier to write dynamic styles based on props
  • Ability to use template literals in style definitions
  • Automatic ThemeProvider support without configuration

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