Styled Components

Learn how styled components work.

Getting started with styled-components

As apps grow, they can contain thousands of style rules, too many for a single person to keep track of. This leads to unintended conflicts. For example, which of the styles below will apply to a disabled button with the white class?

// StylesheetA.css
button.white {
  background-color: white;
  color: black;
}

// StylesheetB.css
button:disabled {
  background-color: grey;
  color: darkgrey;
}

The answer is that it depends on the order the stylesheets ...