@@ -24,6 +24,25 @@ When following the conventions listed below, the Optimizing CSS Compiler
24
24
- Don't use any CSS preprocessors (yet! also will be doable long term)
25
25
- Don't add class names within ` component.js ` files (yet! most usage in this pattern will eventually be allowed)
26
26
27
+ ## Why?
28
+
29
+ Existing scoped and inline style solutions lead to selector bloat and limited
30
+ style reusability. While the scoping and isolation is a great mental model,
31
+ it's not as great for the browser, which can better optimize styles it has
32
+ already seen.
33
+
34
+ The approach here allows us to write CSS as if it were scoped, and have it
35
+ behave scoped at runtime as well. But unlike other solutions, you will ship
36
+ the smallest possible CSS file with the fewest possible selectors.
37
+
38
+ This has the double effect of reducing the size of your template files
39
+ by eliminating long and multiple class names in favor of short "sha" based
40
+ selectors.
41
+
42
+ In dev mode, we'll keep your selectors scoped but expanded so you can
43
+ see quickly what has been applied, while in production we will aggressively
44
+ minimize and combine your selectors as much as possible.
45
+
27
46
## Installation
28
47
29
48
* ` git clone <repository-url> ` this repository
0 commit comments