Tech Tree of the Web

The history of web technology, 1945 to now: 112 ideas and the lines between them. Drag, scroll or press ← → to travel. Open any one for its story.

No. 096 / 112Seen 0 / 112Colophon

The Platform

CSS-in-JS, 2014. Era V, The Platform.

Era V · 2008–2016

← drag · scroll · arrow keys →

2014{ }const styles = { button: { color: 'tomato', padding: 8, },};<button style={styles.button}>

Styles written as JavaScript objects next to the component that uses them. Typeset for this timeline: no licence-clean photograph of the thing itself was found.

Key details

When
2014 (talk slides dated 8 November)
Who
Christopher "vjeux" Chedeau, Facebook
Where
Facebook, front-end infrastructure team
Answered
It answered the problems of CSS at scale: one global namespace, hidden dependencies, dead code and order-dependent rules.
Led to
It led to libraries such as styled-components, Emotion and JSS that write component styles in JavaScript.

No. 096 · 2014 · Style · Era V, The Platform

CSS-in-JS

Moved styles into JavaScript next to components, trading global class names for scoped ones.

Facts

  1. Chedeau's talk React: CSS in JS is dated 8 November 2014; he worked on Facebook's front-end infrastructure and helped build React. 1
  2. The talk listed seven problems with CSS at scale, including global namespace, dead code elimination, minification and non-deterministic resolution. 1
  3. Chedeau's slides said Bootstrap introduced about 600 global variables into a page's styles. 1
  4. The styled-components library, which writes styles in tagged template strings, carries a copyright from 2016. 2

Sources

  1. Chedeau, React: CSS in JS, Speaker Deck, November 2014
  2. styled-components on GitHub
Came from
Led to
Nothing on this tree yet