@codecavepro/brand 1.0.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.
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org>
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # @codecavepro/brand
2
+
3
+ The CODECAVE design system as **CSS custom properties** and as a **typed module** —
4
+ colour, typography and layout tokens, with no runtime, no provider and no component
5
+ bundle.
6
+
7
+ Link one stylesheet and the whole system is live on `:root`.
8
+
9
+ > **Status: stable.** The token *values* mirror what
10
+ > [codecave.pro](https://codecave.pro) ships, and the package *layout* — export paths,
11
+ > module shape — is settled under semver: an export will not move or disappear outside a
12
+ > major bump. Token *values* can change in a minor or patch release, because they track a
13
+ > living design system; pin an exact version if you need them frozen.
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install @codecavepro/brand
19
+ ```
20
+
21
+ ## Quick start
22
+
23
+ ```css
24
+ @import "@codecavepro/brand/css";
25
+ ```
26
+
27
+ That is the whole setup. Every token is now a custom property on `:root`:
28
+
29
+ ```css
30
+ .card {
31
+ background: var(--color-surface-secondary);
32
+ border-radius: var(--radius-card);
33
+ color: var(--color-body-primary);
34
+ }
35
+
36
+ .card a {
37
+ color: var(--color-action);
38
+ }
39
+ ```
40
+
41
+ **Consume the semantic layer** — `--color-action`, `--color-surface-secondary`,
42
+ `--color-body-primary`. The raw ramps (`--color-brand-500`, `--color-gray-1100`) exist
43
+ only so the semantic names have somewhere to point; using them directly is how a
44
+ redesign turns into a find-and-replace across your codebase.
45
+
46
+ ### No build step, if you prefer
47
+
48
+ The same file is served, byte for byte, from the published design system:
49
+
50
+ ```html
51
+ <link rel="stylesheet" href="https://brand.codecave.pro/colors_and_type.css">
52
+ ```
53
+
54
+ The package build asserts that identity, so the file in your `node_modules` and the
55
+ file at that URL are provably the same bytes.
56
+
57
+ ## Fonts: this package ships none
58
+
59
+ `@codecavepro/brand/css` declares six `@font-face` rules for **Satoshi**, but **no font
60
+ binaries are included** — that is a licensing question, not an oversight. Until you
61
+ supply the files, the faces 404 and the browser falls back down the stack
62
+ (`-apple-system`, `Segoe UI`, Roboto, …). Tokens, colours and the type *scale* are all
63
+ correct regardless; only the typeface is missing.
64
+
65
+ The two stylesheets expect the files in **different places**, because one is meant to be
66
+ dropped into a project on its own:
67
+
68
+ | Import | `@font-face` URLs | Put the `.woff2`/`.woff` files at |
69
+ |---|---|---|
70
+ | `@codecavepro/brand/css` | `./fonts/Satoshi-*.woff2` | a `fonts/` directory **beside** the stylesheet |
71
+ | `@codecavepro/brand/fonts.css` | `./Satoshi-*.woff2` | **beside** the stylesheet itself |
72
+
73
+ Get the cuts from [Fontshare](https://www.fontshare.com/fonts/satoshi) — Light 300,
74
+ Regular 400, Italic, Medium 500, Bold 700, Black 900. Bind each with a real
75
+ `font-weight` descriptor rather than letting the browser synthesize; the design system
76
+ documents why in [DESIGN.md §10.3](https://github.com/CodeCavePro/brand/blob/development/docs/DESIGN.md#103-synthesized-vs-real-font-weights).
77
+
78
+ ## The typed module
79
+
80
+ For consumers that cannot read a stylesheet — design tooling, canvas/WebGL renderers,
81
+ PDF and email builders, native apps:
82
+
83
+ ```ts
84
+ import { color, radius, fontSize, spacing, gradientBrand } from '@codecavepro/brand';
85
+
86
+ color.action; // '#5F20FE'
87
+ color.surfaceSecondary; // '#0F0F15'
88
+ radius.card; // '1.5rem'
89
+ fontSize.headingLg; // { size: '3.5rem', lineHeight: '130%' }
90
+ fontSize.body; // { size: '1rem', lineHeight: '1.5rem' }
91
+ spacing.sectionPaddingTop; // '12.5rem'
92
+ ```
93
+
94
+ The body steps are `stat`, `subhead`, `md`, `label`, `body`, `caption` — named
95
+ for their job rather than as t-shirt sizes. That is deliberate and worth copying
96
+ if you build on this: `lg`, `sm` and `base` are Tailwind default theme names, and
97
+ because this package's `:root` is unlayered it would beat Tailwind's `@layer
98
+ theme` and silently resize every `text-lg` and `text-sm` in your app.
99
+
100
+ Everything is `as const`, so the values are literal types, and the key unions are
101
+ exported for building your own maps:
102
+
103
+ ```ts
104
+ import type { SemanticColor, Radius, FontSizeStep } from '@codecavepro/brand';
105
+ ```
106
+
107
+ | Module | Exports |
108
+ |---|---|
109
+ | colour | `brand`, `gray`, `accent`, `technologyGradient`, `error`, `color`, `gradientBrand` |
110
+ | layout | `radius`, `gutter`, `spacing`, `shadow`, `maxWidthDesktop`, `breakpointSm` |
111
+ | typography | `fontFamily`, `fontSize`, `fontWeight`, `eyebrow` |
112
+
113
+ Two things to know about it:
114
+
115
+ - **Size and line-height travel together.** `fontSize` steps are objects for that
116
+ reason — never pair a size with a line-height from a different step.
117
+ - **The CSS is the source of truth.** This module is a faithful mirror of it. If the
118
+ two ever disagree, the CSS wins and the module is the bug.
119
+
120
+ ## Controls are 48px, and it is a floor
121
+
122
+ `spacing.controlHeight` / `--control-height` is `3rem` — 48px, what codecave.pro
123
+ actually renders. `.btn` applies it as `min-height` rather than `height`, so a button
124
+ whose label wraps grows instead of clipping. If you build your own controls from the
125
+ token, do the same.
126
+
127
+ 48px clears WCAG 2.5.5 AAA outright rather than merely meeting 2.5.8 AA, so there is no
128
+ separate mobile size.
129
+
130
+ ## Documentation
131
+
132
+ This README covers installing and consuming the package. The design system itself —
133
+ the rules, the reasoning, the anti-patterns — is documented separately:
134
+
135
+ - **[brand.codecave.pro](https://brand.codecave.pro/)** — the published design system:
136
+ brand kit, foundation specimens, and a storybook of real components.
137
+ - **[DESIGN.md](https://github.com/CodeCavePro/brand/blob/development/docs/DESIGN.md)** —
138
+ the rules in full: the 26-step ramp, components, motion, anti-patterns, known
139
+ divergences from what the site ships today.
140
+ - **[CodeCavePro/brand](https://github.com/CodeCavePro/brand)** — the repository.
141
+
142
+ ## How this package is built
143
+
144
+ It authors nothing. Every byte is copied or compiled out of `docs/` in the repository
145
+ above: the CSS is copied verbatim, and the typed module is compiled from
146
+ `docs/tokens/*.ts`. `docs/` stays the single origin, and CI asserts the byte-identity
147
+ on every push.
148
+
149
+ Two editable copies of a palette is the exact failure this package exists to end, so it
150
+ would be self-defeating to introduce a second one on the way there. **Fixes go to
151
+ `docs/`, never to `packages/`.**
152
+
153
+ ## Licence
154
+
155
+ [Unlicense](https://github.com/CodeCavePro/brand/blob/development/LICENSE). The
156
+ CODECAVE name and marks are not covered by it.