@unocss/runtime 0.50.8 → 0.51.1
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 +2 -97
- package/attributify.global.js +3 -3
- package/core.global.js +2 -2
- package/full.global.js +3 -3
- package/mini.global.js +3 -3
- package/package.json +4 -4
- package/uno.global.js +3 -3
package/README.md
CHANGED
|
@@ -2,104 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
CSS-in-JS runtime of UnoCSS.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Documentation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```html
|
|
10
|
-
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime"></script>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
To configure UnoCSS (optional):
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<script>
|
|
17
|
-
// pass unocss options
|
|
18
|
-
window.__unocss = {
|
|
19
|
-
rules: [
|
|
20
|
-
// custom rules...
|
|
21
|
-
],
|
|
22
|
-
presets: [
|
|
23
|
-
// custom presets...
|
|
24
|
-
],
|
|
25
|
-
// ...
|
|
26
|
-
}
|
|
27
|
-
</script>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
By default, `@unocss/preset-uno` will be applied.
|
|
31
|
-
|
|
32
|
-
The runtime does not come with preflights, if you want to have style resets, you can either add your own, or use one from `@unocss/reset`:
|
|
33
|
-
|
|
34
|
-
```html
|
|
35
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@unocss/reset/normalize.min.css">
|
|
36
|
-
<!-- or -->
|
|
37
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@unocss/reset/tailwind.min.css">
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### CDN Builds
|
|
41
|
-
|
|
42
|
-
###### Core
|
|
43
|
-
|
|
44
|
-
Without any preset:
|
|
45
|
-
|
|
46
|
-
```html
|
|
47
|
-
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime/core.global.js"></script>
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
###### Uno (default)
|
|
51
|
-
|
|
52
|
-
With `@unocss/preset-uno` preset:
|
|
53
|
-
|
|
54
|
-
```html
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime/uno.global.js"></script>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
###### Attributify
|
|
59
|
-
|
|
60
|
-
With `@unocss/preset-uno` and `@unocss/preset-attributify` presets:
|
|
61
|
-
|
|
62
|
-
```html
|
|
63
|
-
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime/attributify.global.js"></script>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
###### Mini
|
|
67
|
-
|
|
68
|
-
With `@unocss/preset-mini` and `@unocss/preset-attributify` preset:
|
|
69
|
-
|
|
70
|
-
```html
|
|
71
|
-
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime/mini.global.js"></script>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Bundler Usage
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
npm i @unocss/runtime
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
```ts
|
|
81
|
-
import initUnocssRuntime from '@unocss/runtime'
|
|
82
|
-
|
|
83
|
-
initUnocssRuntime({ /* options */ })
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Preventing flash of unstyled content
|
|
87
|
-
|
|
88
|
-
Since UnoCSS runs after the DOM is present, there can be a "flash of unstyled content" which may leads the user to see the page as unstyled.
|
|
89
|
-
|
|
90
|
-
Use `un-cloak` attribute with CSS rules such as `[un-cloak] { display: none }` to hide the unstyled element until UnoCSS applies the styles for it.
|
|
91
|
-
|
|
92
|
-
```css
|
|
93
|
-
[un-cloak] {
|
|
94
|
-
display: none;
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
```html
|
|
99
|
-
<div class="text-blue-500" un-cloak>
|
|
100
|
-
This text will only be visible in blue color.
|
|
101
|
-
</div>
|
|
102
|
-
```
|
|
7
|
+
Please refer to the [documentation](https://unocss.dev/integrations/runtime).
|
|
103
8
|
|
|
104
9
|
## License
|
|
105
10
|
|