@contentstudio/ui 0.1.58 → 0.2.2
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 +18 -0
- package/dist/index.d.ts +896 -12
- package/dist/index.js +12083 -11308
- package/dist/index.umd.cjs +1633 -1618
- package/dist/style.css +1 -1
- package/dist/tailwind-6a119e86.cjs +66 -0
- package/dist/tailwind-9ac4bb2b.js +2010 -0
- package/dist/tailwind.d.ts +107 -0
- package/dist/tailwind.js +12 -0
- package/dist/tailwind.umd.cjs +1 -0
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -22,6 +22,24 @@ pnpm dev:docs
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
+
### Dynamic theming
|
|
26
|
+
|
|
27
|
+
Load the default theme variables automatically (already included in the compiled `style.css`). To override them at runtime, call the theme generator:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { generatePalette, applyTheme } from '@contentstudio/ui'
|
|
31
|
+
|
|
32
|
+
// create your palette (change primary brand color, etc.)
|
|
33
|
+
const palette = generatePalette({ primary: '#ff0066' })
|
|
34
|
+
|
|
35
|
+
// apply CSS variables to :root
|
|
36
|
+
applyTheme(palette)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you are using Nuxt/SSR, compute the palette on the server and inline the generated variables in a `<style>` tag during rendering to avoid FOUC.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
25
43
|
Import the components you need in your Vue.js application:
|
|
26
44
|
|
|
27
45
|
```javascript
|