Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit de82f00

Browse files
add explanation
1 parent 95e332d commit de82f00

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ When following the conventions listed below, the Optimizing CSS Compiler
2424
- Don't use any CSS preprocessors (yet! also will be doable long term)
2525
- Don't add class names within `component.js` files (yet! most usage in this pattern will eventually be allowed)
2626

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+
2746
## Installation
2847

2948
* `git clone <repository-url>` this repository

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /