@codecavepro/brand 1.2.0 → 1.3.0

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.
Files changed (3) hide show
  1. package/README.md +22 -11
  2. package/dist/theme.css +81 -0
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -169,20 +169,28 @@ surprises you.
169
169
  `vue` is a peer dependency. `gsap` is an optional one, wanted only by `GlowButton`,
170
170
  `TypingEffect` and `ContactUsForm`; leave it out and the rest are unaffected.
171
171
 
172
- ### They need your Tailwind theme, not just the tokens
172
+ ### Import the theme, not just the tokens
173
173
 
174
174
  Every colour, radius and control height in these components is a token — but they reach
175
175
  most of them through **Tailwind utility classes** (`bg-surface-primary`,
176
- `text-heading-lg`, `rounded-card`), and a utility class only exists if Tailwind knows
177
- the name. Importing `@codecavepro/brand/tokens.css` gives you the *values*; it does not
178
- give Tailwind the `@theme` entries that turn them into classes.
176
+ `text-heading-md`, `rounded-custom`), and a utility class exists only if Tailwind knows
177
+ the name. `tokens.css` gives you the *values*; `theme.css` gives Tailwind the names, so
178
+ you need both:
179
179
 
180
- Until this package ships that block, mirror it in your own stylesheet — the definitive
181
- copy is the `@theme { … }` in codecave.pro's `src/styles/global.css`, reproduced in this
182
- repository at `docs/source_examples/styles/global.css`. Without it the components mount
183
- and behave correctly and render nearly unstyled.
180
+ ```css
181
+ @import "tailwindcss";
182
+ @import "@codecavepro/brand/tokens.css";
183
+ @import "@codecavepro/brand/theme.css";
184
+ ```
185
+
186
+ **That order is load-bearing, and `tokens.css` must stay unlayered.** Several entries in
187
+ `theme.css` are deliberate self-references (`--color-glow-25: var(--color-glow-25)`):
188
+ the declaration is what makes Tailwind emit the utility, while the value comes from
189
+ `tokens.css`, whose unlayered `:root` outranks `@layer theme`. Wrap `tokens.css` in a
190
+ cascade layer — or leave it out — and those names resolve to nothing.
184
191
 
185
- Tracked as [CCWEB2-333](https://codecave.atlassian.net/browse/CCWEB2-333).
192
+ Import only `tokens.css` and the components mount and behave correctly and render
193
+ nearly unstyled.
186
194
 
187
195
  ### What is not here, and why
188
196
 
@@ -220,8 +228,11 @@ the rules, the reasoning, the anti-patterns — is documented separately:
220
228
 
221
229
  It authors nothing. Every byte is copied, extracted or compiled out of `docs/` in the
222
230
  repository above: `css` and `fonts.css` are copied verbatim, `tokens.css` is extracted
223
- from the same file `css` is copied from, and the typed module is compiled from
224
- `docs/tokens/*.ts`. `docs/` stays the single origin, and CI asserts on every push that
231
+ from the same file `css` is copied from, `theme.css` is extracted from the capture of
232
+ codecave.pro's `global.css`, and the typed module is compiled from `docs/tokens/*.ts`.
233
+ A name that `theme.css` and `tokens.css` both give a literal value must agree, and the
234
+ build fails if it does not — otherwise one of the two would be dead and nobody would
235
+ see it. `docs/` stays the single origin, and CI asserts on every push that
225
236
  the copies are byte-identical and the extraction still reproduces what shipped.
226
237
 
227
238
  Two editable copies of a palette is the exact failure this package exists to end, so it
package/dist/theme.css ADDED
@@ -0,0 +1,81 @@
1
+ /* ==========================================================================
2
+ * CODECAVE Tailwind theme — @codecavepro/brand/theme.css
3
+ * --------------------------------------------------------------------------
4
+ * GENERATED from docs/source_examples/styles/global.css — do not edit.
5
+ *
6
+ * Declares the names Tailwind needs in order to emit CODECAVE utility
7
+ * classes: bg-surface-primary, text-heading-lg, rounded-card and the rest.
8
+ * Without it the components in this package mount and behave correctly and
9
+ * render nearly unstyled.
10
+ *
11
+ * IMPORT ORDER MATTERS, and this file is wrong without it:
12
+ *
13
+ * @import "tailwindcss";
14
+ * @import "@codecavepro/brand/tokens.css"; <- must come first,
15
+ * @import "@codecavepro/brand/theme.css"; and stay unlayered
16
+ *
17
+ * Several entries here are deliberate self-references (--x: var(--x)). They
18
+ * exist so Tailwind emits the utility; the value comes from tokens.css,
19
+ * whose unlayered :root outranks @layer theme. Import tokens.css inside a
20
+ * cascade layer, or not at all, and those names resolve to nothing.
21
+ * ======================================================================== */
22
+
23
+ @theme {
24
+
25
+ /* sizes */
26
+ --max-width-desktop: 1280px;
27
+ --breakpoint-sm: 457px;
28
+ --font-sans: Satoshi, sans-serif;
29
+ --text-heading-lg: 3.5rem;
30
+ --text-heading-lg--line-height: 130%;
31
+ --text-heading-md: 2.75rem;
32
+ --text-heading-md--line-height: 115%;
33
+ --text-heading-sm: 2rem;
34
+ --text-heading-sm--line-height: 110%;
35
+ --radius-custom: 2.75rem;
36
+
37
+ /* colors */
38
+
39
+ /* primary */
40
+ --color-primary-25: var(--color-brand-25);
41
+ --color-primary-50: var(--color-brand-50);
42
+ --color-primary-100: var(--color-brand-100);
43
+ --color-primary-200: var(--color-brand-200);
44
+ --color-primary-300: var(--color-brand-300);
45
+ --color-primary-400: var(--color-brand-400);
46
+ --color-primary-500: var(--color-brand-500); /* button primary*/
47
+ --color-primary-600: var(--color-brand-600);
48
+ --color-primary-700: var(--color-brand-700); /* button primary hover*/
49
+ --color-primary-800: var(--color-brand-800);
50
+ --color-primary-900: var(--color-brand-900); /* button primary active*/
51
+
52
+
53
+ /* once used? */
54
+ --color-glow-25: var(--color-glow-25);
55
+ --color-progress-0: var(--color-progress-0);
56
+ --color-technology-gradient-0: var(--color-technology-gradient-0);
57
+ --color-technology-gradient-25: var(--color-technology-gradient-25);
58
+ --color-technology-gradient-50: var(--color-technology-gradient-50);
59
+ --color-shadow-0: var(--color-shadow-0);
60
+ --color-failureproof-0: var(--color-gray-1000);
61
+
62
+ --color-heading: var(--color-gray-50);
63
+ --color-action: var(--color-brand-500);
64
+ --color-neutral: var(--color-gray-600);
65
+ --color-hovered: var(--color-brand-200);
66
+ --color-outline-primary-hover: var(--color-brand-800);
67
+ --color-body-primary: var(--color-gray-50);
68
+ --color-text-body-primary: var(--color-gray-200);
69
+ --color-body-secondary: var(--color-gray-500);
70
+ --color-body-secondary-lighter: var(--color-gray-300);
71
+ --color-surface-primary: var(--color-brand-950);
72
+ --color-surface-primary-hover: var(--color-gray-800);
73
+ --color-surface-secondary: var(--color-gray-1100); /* Surface/background-secondary*/
74
+ --color-surface-tertiary: var(--color-gray-900);
75
+ --color-surface-primary-transparent: hsl(from var(--color-surface-primary) h s l / 0.3);
76
+ --color-surface-quaternary: var(--color-gray-700);
77
+
78
+ --color-default-transparent: var(--color-gray-100);
79
+
80
+ --color-error: var(--color-error-300);
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codecavepro/brand",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "CODECAVE design system — colour, typography and layout tokens as CSS custom properties and as a typed module.",
5
5
  "license": "Unlicense",
6
6
  "type": "module",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "./css": "./dist/colors_and_type.css",
28
28
  "./tokens.css": "./dist/tokens.css",
29
+ "./theme.css": "./dist/theme.css",
29
30
  "./fonts.css": "./dist/fonts.css",
30
31
  "./components/*": "./dist/src/components/*",
31
32
  "./assets/*": "./dist/src/assets/*",