Inline styles
Inline CSS is a style defined and applied directly to individual elements in the view. Although this takes care of some of the problems faced when using external style sheets, such as eliminating the issue of selector conflicts and allowing state-dependent styles, it takes away reusability and introduces a few problems of its own, such as limiting the CSS features that can be applied.
Using only inline CSS for a React-based frontend has important limitations for growing applications, such as poor performance because all of the inline styles are recomputed at each render, and inline styles are slower than class names, to begin with.
Inline CSS may seem like an easy fix in some cases, but it does not serve as a good option for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access