@contentstudio/ui 0.1.58 → 0.2.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 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