@bcc-code/design-tokens 0.5.0 → 1.0.3

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
@@ -1,10 +1,101 @@
1
- # @bcc-code/design-tokens
2
- A collection of tokens from the BCC design system.
1
+ # @bcc-code/design-tokens – Light & Dark Theme
3
2
 
4
- [![version](https://img.shields.io/npm/v/@bcc-code/design-tokens)](https://github.com/bcc-code/bcc-design-tokens/releases) [![license](https://img.shields.io/npm/l/@bcc-code/design-tokens)](https://github.com/bcc-code/bcc-design-tokens/blob/main/LICENSE)
3
+ ![version](https://img.shields.io/npm/v/@bcc-code/design-tokens?color=blue&label=version)
4
+ ![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@bcc-code/design-tokens/badge)
5
+ [![Publish to NPM](https://github.com/bcc-code/design-tokens/actions/workflows/publish.yml/badge.svg)](https://github.com/bcc-code/design-tokens/actions/workflows/publish.yml)
5
6
 
6
- ## Installation & Usage
7
- Refer to the [documentation](https://developer.bcc.no/bcc-design/tokens) for installation instructions and usage information.
7
+ A scoped design token package with light and dark themes, usable across PrimeVue, WordPress, and plain HTML/JS projects. Built with [Style Dictionary](https://amzn.github.io/style-dictionary/#/).
8
8
 
9
- ## License
10
- This package is licensed under the [Apache 2.0 license](./LICENSE).
9
+ ## ✨ Features
10
+
11
+ - ✅ Light and dark theme support
12
+ - ✅ Zero-config CSS variables (primitives + semantic)
13
+ - ✅ Available via NPM and CDN
14
+ - ✅ Built-in PrimeVue `aura`-compatible preset
15
+ - ✅ Works in WordPress, Vue, and vanilla HTML
16
+ - ✅ Scalable architecture for future token sets and themes
17
+
18
+ ---
19
+
20
+ ## 📦 Installation & Usage
21
+
22
+ ### ▶️ Install via NPM (for Vue/PrimeVue)
23
+
24
+ ```bash
25
+ npm install @bcc-code/design-tokens
26
+ ```
27
+
28
+ In your `main.js`:
29
+
30
+ ```js
31
+ import "@bcc-code/design-tokens/dist/variables.css"; // Injects all CSS variables
32
+ import { primeVuePreset } from "@bcc-code/design-tokens";
33
+
34
+ app.use(PrimeVue, {
35
+ theme: {
36
+ preset: primeVuePreset,
37
+ darkModeSelector: ".dark-mode", // You toggle this class manually or via script
38
+ },
39
+ });
40
+ ```
41
+
42
+ ### 🌐 Use via CDN (WordPress / HTML / No Build Tools)
43
+
44
+ ```html
45
+ <link
46
+ rel="stylesheet"
47
+ href="https://cdn.jsdelivr.net/npm/@bcc-code/design-tokens@1.0.0/dist/variables.css"
48
+ />
49
+ ```
50
+
51
+ To enable dark mode, add this to your HTML:
52
+
53
+ ```html
54
+ <html class="dark-mode"></html>
55
+ ```
56
+
57
+ Optional: Use a script with `prefers-color-scheme` to toggle `.dark-mode` dynamically.
58
+
59
+ ### 📁 Project Structure
60
+
61
+ ```txt
62
+ tokens/ # Source tokens (JSON)
63
+ export-tokens/ # Style Dictionary config + custom generators
64
+ build/ # Intermediate Style Dictionary outputs
65
+ dist/ # Final NPM/CDN-ready files
66
+ ├── variables.css # Combined light + dark + primitives CSS variables
67
+ └── primevue-preset.js # PrimeVue theme preset (Aura-compatible)
68
+ ```
69
+
70
+ ### ⚙ How It Works (Build System)
71
+
72
+ 1. Tokens are defined in `tokens/` (primitives, semantic, themes)
73
+
74
+ 2. Style Dictionary transforms them using custom scripts
75
+
76
+ 3. Output files are:
77
+
78
+ - `variables.css`: all CSS variables under `:root` and `.dark-mode`
79
+ - `primevue-preset.js`: an override object usable in PrimeVue
80
+
81
+ Run the build:
82
+
83
+ ```bash
84
+ npm run build
85
+ ```
86
+
87
+ ### 🧱 Token Structure
88
+
89
+ - **primitives**: base values (e.g. `--color-neutral-100`)
90
+
91
+ - **semantic**: tokens with purpose-based names (`--color-surface-primary`)
92
+
93
+ - **light / dark**: theme-specific values using the same semantic names
94
+
95
+ - `variables.css`: combines all and respects CSS variable cascade rules
96
+
97
+ ### 📄 License
98
+
99
+ MIT
100
+
101
+ Note: All CDN and NPM imports use the `@bcc-code/design-tokens` scope. If you fork this project or publish your own, replace all references accordingly.
@@ -0,0 +1,5 @@
1
+ export const primeVuePreset = {
2
+ "base": "Aura",
3
+ "overrides": {},
4
+ "darkModeSelector": ".dark-mode"
5
+ };