@jesscss/patch-css 2.0.0-alpha.7 → 2.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
|
-
# patch-css
|
|
1
|
+
# @jesscss/patch-css
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
**A tiny runtime helper that attaches cached stylesheets from `localStorage` in
|
|
4
|
+
the document head.**
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
`@jesscss/patch-css` is a small browser utility from the
|
|
7
|
+
[Jess](https://github.com/jesscss/jess) project (Less.js v5, a ground-up rewrite
|
|
8
|
+
of the Less CSS preprocessor). Loaded synchronously in the `<head>` — without
|
|
9
|
+
`async` or `defer` — it re-attaches any stylesheets that were previously cached in
|
|
10
|
+
`localStorage`, so styling is in place before first paint.
|
|
11
|
+
|
|
12
|
+
It exposes a single function, `updateSheet(text, id)`, which inserts (or updates)
|
|
13
|
+
a `<style>` element for the given id and writes the current stylesheet cache back
|
|
14
|
+
to `localStorage`. To refresh the cache, call `updateSheet` for each stylesheet.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install @jesscss/patch-css
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The `latest` and `alpha` dist-tags both point at the current alpha.
|
|
23
|
+
|
|
24
|
+
## Status
|
|
25
|
+
|
|
26
|
+
Alpha, and an early utility surface — expect the shape to change. Please
|
|
27
|
+
[report bugs](https://github.com/jesscss/jess/issues).
|
|
28
|
+
|
|
29
|
+
## Links
|
|
30
|
+
|
|
31
|
+
- Repository: <https://github.com/jesscss/jess>
|
|
32
|
+
- Documentation: <https://jesscss.github.io/> (currently pre-alpha content)
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
[MIT](https://github.com/jesscss/jess/blob/dev/LICENSE)
|