@unocss/runtime 0.30.3 → 0.30.6

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 CHANGED
@@ -83,6 +83,24 @@ import initUnocssRuntime from '@unocss/runtime'
83
83
  initUnocssRuntime({ /* options */ })
84
84
  ```
85
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
+ ```
103
+
86
104
  ## License
87
105
 
88
106
  MIT License © 2021 [Anthony Fu](https://github.com/antfu)