External style sheets
External style sheets allow us to define CSS rules in separate files, which can be injected into the necessary view. Placing CSS styles in external style sheets this way was once considered the best practice because it enforced the separation of style and content, allowing reusability and also maintaining modularity if a separate CSS file was created for each component.
However, as web development technologies continue evolving, the demands of better CSS organization and performance are no longer met by this approach. For example, using external style sheets while developing frontend views with React components limits our control over updating styles based on the component state. Moreover, loading external CSS for React ...
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