@codenhub/styles 0.0.3 → 0.1.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 (75) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +52 -0
  3. package/README.md +60 -90
  4. package/dist/aesthetics/chunky-tile.css +1 -0
  5. package/dist/aesthetics/glass.css +1 -0
  6. package/dist/aesthetics/index.css +2 -0
  7. package/dist/aesthetics/neobrutalism.css +1 -0
  8. package/dist/aesthetics/pixel.css +1 -0
  9. package/dist/components.css +2 -2
  10. package/dist/index.css +2 -2
  11. package/dist/native.css +2 -0
  12. package/dist/theme.css +2 -2
  13. package/dist/tw/aesthetics/chunky-tile.css +107 -0
  14. package/dist/tw/aesthetics/glass.css +66 -0
  15. package/dist/tw/aesthetics/index.css +9 -0
  16. package/dist/tw/aesthetics/neobrutalism.css +63 -0
  17. package/dist/tw/aesthetics/pixel.css +88 -0
  18. package/dist/tw/box.css +185 -0
  19. package/dist/tw/components/button.css +88 -0
  20. package/dist/tw/components/feedback.css +163 -0
  21. package/dist/tw/components/form.css +601 -0
  22. package/dist/tw/components/index.css +18 -0
  23. package/dist/tw/components/loader.css +122 -0
  24. package/dist/tw/components/surface.css +98 -0
  25. package/dist/tw/components/tooltip.css +132 -0
  26. package/dist/tw/elevation.css +39 -0
  27. package/dist/tw/index.css +12 -0
  28. package/dist/tw/intent.css +189 -0
  29. package/dist/tw/native.css +203 -0
  30. package/dist/tw/presentation.css +77 -0
  31. package/dist/tw/reset.css +142 -0
  32. package/dist/tw/theme.css +218 -0
  33. package/dist/tw/typography.css +34 -0
  34. package/dist/tw/utilities/content.css +349 -0
  35. package/dist/tw/utilities/index.css +6 -0
  36. package/dist/tw/utilities/layout.css +107 -0
  37. package/docs/accessibility.md +43 -14
  38. package/docs/concepts.md +94 -0
  39. package/docs/index.md +62 -73
  40. package/docs/integrating/astro.md +29 -0
  41. package/docs/integrating/index.md +32 -0
  42. package/docs/integrating/nextjs.md +44 -0
  43. package/docs/integrating/svelte.md +37 -0
  44. package/docs/integrating/tailwind.md +40 -0
  45. package/docs/integrating/vue.md +25 -0
  46. package/docs/setup.md +116 -0
  47. package/docs/usage/aesthetics.md +197 -0
  48. package/docs/usage/buttons.md +74 -0
  49. package/docs/usage/composing.md +218 -0
  50. package/docs/usage/content-and-layout.md +200 -0
  51. package/docs/usage/customizing.md +213 -0
  52. package/docs/usage/feedback.md +117 -0
  53. package/docs/usage/forms.md +177 -0
  54. package/docs/usage/index.md +32 -0
  55. package/docs/usage/theming.md +210 -0
  56. package/docs/usage/tooltips.md +45 -0
  57. package/llms-full.txt +2122 -0
  58. package/llms.txt +26 -0
  59. package/package.json +96 -32
  60. package/docs/classes.md +0 -198
  61. package/docs/roadmap.md +0 -34
  62. package/docs/tests.md +0 -128
  63. package/docs/tokens.md +0 -101
  64. package/src/components/button.css +0 -155
  65. package/src/components/feedback.css +0 -214
  66. package/src/components/form.css +0 -296
  67. package/src/components/index.css +0 -9
  68. package/src/components/loader.css +0 -56
  69. package/src/components/surface.css +0 -6
  70. package/src/components/tooltip.css +0 -60
  71. package/src/index.css +0 -7
  72. package/src/overrides.css +0 -76
  73. package/src/theme.css +0 -136
  74. package/src/typography.css +0 -30
  75. package/src/utilities.css +0 -40
package/llms.txt ADDED
@@ -0,0 +1,26 @@
1
+ # @codenhub/styles
2
+
3
+ > CSS-only Codenhub design tokens, reset, typography, layout and content utilities, component classes, native-element styling, and Tailwind CSS v4 source entrypoints.
4
+
5
+ Use compiled entrypoints for ready-to-import CSS or `/tw` entrypoints in a
6
+ Tailwind CSS v4 build. The package has no JavaScript behavior. Supported behavior
7
+ is the surface documented in public docs and demonstrated by the playground.
8
+
9
+ ## Documentation
10
+
11
+ - [Documentation](./docs/index.md): Primary entrypoint — what the package is, what it does and does not do, and where to go next.
12
+ - [README](./README.md): Installation, first use, requirements, and stability notes.
13
+ - [Setup](./docs/setup.md): Installation, entrypoint/import-path reference, configuration, and requirements.
14
+ - [Concepts](./docs/concepts.md): The three-axis model, the token system, and theme-selector precedence.
15
+ - [Usage](./docs/usage/index.md): Composing, theming, customizing, aesthetics, and each component family.
16
+ - [Composing](./docs/usage/composing.md): Combining axes, presentation, the component axis matrix, and elevation.
17
+ - [Theming](./docs/usage/theming.md): Color, intent, and foundation token reference.
18
+ - [Customizing](./docs/usage/customizing.md): Presentation, material, and aesthetic token reference.
19
+ - [Aesthetics](./docs/usage/aesthetics.md): Each shipped aesthetic and its documented exceptions.
20
+ - [Buttons](./docs/usage/buttons.md)
21
+ - [Forms](./docs/usage/forms.md)
22
+ - [Feedback](./docs/usage/feedback.md)
23
+ - [Tooltips](./docs/usage/tooltips.md)
24
+ - [Content and layout](./docs/usage/content-and-layout.md): Layout helpers, content chips/tables, surfaces, and typography utilities.
25
+ - [Integrating](./docs/integrating/index.md): Wiring the stylesheet into Next.js, Vue, Svelte, Astro, or a Tailwind CSS v4 build.
26
+ - [Accessibility](./docs/accessibility.md): CSS accessibility behavior and consumer responsibilities.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codenhub/styles",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "description": "CSS-only Codenhub design tokens, base styles, and composable UI helper classes.",
6
6
  "homepage": "https://github.com/codenhub/codenhub/tree/main/packages/styles",
@@ -11,35 +11,89 @@
11
11
  "directory": "packages/styles"
12
12
  },
13
13
  "files": [
14
- "docs",
15
14
  "dist",
16
- "src"
15
+ "NOTICE",
16
+ "README.md",
17
+ "docs",
18
+ "llms.txt",
19
+ "llms-full.txt"
17
20
  ],
18
21
  "type": "module",
19
22
  "exports": {
20
- ".": "./dist/index.css",
21
- "./theme": "./dist/theme.css",
22
- "./components": "./dist/components.css",
23
- "./tw": "./src/index.css",
24
- "./tw/theme": "./src/theme.css",
25
- "./tw/components": "./src/components/index.css",
26
- "./tw/surface": "./src/components/surface.css",
27
- "./tw/button": "./src/components/button.css",
28
- "./tw/form": "./src/components/form.css",
29
- "./tw/feedback": "./src/components/feedback.css",
30
- "./tw/loader": "./src/components/loader.css",
31
- "./tw/tooltip": "./src/components/tooltip.css",
32
- "./tw/utilities": "./src/utilities.css"
23
+ ".": {
24
+ "style": "./dist/index.css",
25
+ "import": "./dist/index.css",
26
+ "default": "./dist/index.css"
27
+ },
28
+ "./theme": {
29
+ "style": "./dist/theme.css",
30
+ "import": "./dist/theme.css",
31
+ "default": "./dist/theme.css"
32
+ },
33
+ "./components": {
34
+ "style": "./dist/components.css",
35
+ "import": "./dist/components.css",
36
+ "default": "./dist/components.css"
37
+ },
38
+ "./aesthetics": {
39
+ "style": "./dist/aesthetics/index.css",
40
+ "import": "./dist/aesthetics/index.css",
41
+ "default": "./dist/aesthetics/index.css"
42
+ },
43
+ "./aesthetics/neobrutalism": {
44
+ "style": "./dist/aesthetics/neobrutalism.css",
45
+ "import": "./dist/aesthetics/neobrutalism.css",
46
+ "default": "./dist/aesthetics/neobrutalism.css"
47
+ },
48
+ "./aesthetics/glass": {
49
+ "style": "./dist/aesthetics/glass.css",
50
+ "import": "./dist/aesthetics/glass.css",
51
+ "default": "./dist/aesthetics/glass.css"
52
+ },
53
+ "./aesthetics/pixel": {
54
+ "style": "./dist/aesthetics/pixel.css",
55
+ "import": "./dist/aesthetics/pixel.css",
56
+ "default": "./dist/aesthetics/pixel.css"
57
+ },
58
+ "./aesthetics/chunky-tile": {
59
+ "style": "./dist/aesthetics/chunky-tile.css",
60
+ "import": "./dist/aesthetics/chunky-tile.css",
61
+ "default": "./dist/aesthetics/chunky-tile.css"
62
+ },
63
+ "./tw": "./dist/tw/index.css",
64
+ "./tw/theme": "./dist/tw/theme.css",
65
+ "./tw/components": "./dist/tw/components/index.css",
66
+ "./tw/surface": "./dist/tw/components/surface.css",
67
+ "./tw/button": "./dist/tw/components/button.css",
68
+ "./tw/form": "./dist/tw/components/form.css",
69
+ "./tw/feedback": "./dist/tw/components/feedback.css",
70
+ "./tw/loader": "./dist/tw/components/loader.css",
71
+ "./tw/tooltip": "./dist/tw/components/tooltip.css",
72
+ "./tw/reset": "./dist/tw/reset.css",
73
+ "./tw/native": "./dist/tw/native.css",
74
+ "./tw/typography": "./dist/tw/typography.css",
75
+ "./tw/utilities": "./dist/tw/utilities/index.css",
76
+ "./tw/aesthetics": "./dist/tw/aesthetics/index.css",
77
+ "./tw/aesthetics/neobrutalism": "./dist/tw/aesthetics/neobrutalism.css",
78
+ "./tw/aesthetics/glass": "./dist/tw/aesthetics/glass.css",
79
+ "./tw/aesthetics/pixel": "./dist/tw/aesthetics/pixel.css",
80
+ "./tw/aesthetics/chunky-tile": "./dist/tw/aesthetics/chunky-tile.css",
81
+ "./native": {
82
+ "style": "./dist/native.css",
83
+ "import": "./dist/native.css",
84
+ "default": "./dist/native.css"
85
+ }
33
86
  },
34
87
  "publishConfig": {
35
88
  "access": "public"
36
89
  },
37
90
  "devDependencies": {
38
- "@playwright/test": "^1.57.0",
39
- "@tailwindcss/cli": "^4.3.0",
40
- "@types/node": "^25.9.1",
41
- "tailwindcss": "^4.3.0",
42
- "typescript": "^6.0.3"
91
+ "@playwright/test": "^1.61.1",
92
+ "@tailwindcss/cli": "^4.3.2",
93
+ "@types/node": "^26.1.0",
94
+ "tailwindcss": "^4.3.2",
95
+ "typescript": "^6.0.3",
96
+ "vitest": "^4.1.10"
43
97
  },
44
98
  "peerDependencies": {
45
99
  "tailwindcss": ">=4.0.0"
@@ -49,18 +103,28 @@
49
103
  "optional": true
50
104
  }
51
105
  },
106
+ "codenhub": {
107
+ "docs": {
108
+ "label": "StyleKit",
109
+ "status": "active"
110
+ }
111
+ },
52
112
  "scripts": {
53
- "dev": "node ./scripts/dev.js",
54
- "build": "pnpm build:styles",
55
- "build:styles": "tailwindcss -i ./src/index.css -o ./dist/index.css --minify && tailwindcss -i ./src/theme.css -o ./dist/theme.css --minify && tailwindcss -i ./src/components/index.css -o ./dist/components.css --minify",
113
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
114
+ "dev": "pnpm --filter=@codenhub/styles-dev dev",
115
+ "debug": "pnpm build && pnpm --filter=@codenhub/styles-debug dev",
116
+ "demo": "pnpm build && pnpm --filter=@codenhub/styles-demo dev",
117
+ "build": "pnpm clean && pnpm build:styles && pnpm build:aesthetics && pnpm build:tw",
118
+ "build:styles": "tailwindcss -i ./src/index.css -o ./dist/index.css --minify && tailwindcss -i ./src/theme.css -o ./dist/theme.css --minify && tailwindcss -i ./src/components/index.css -o ./dist/components.css --minify && tailwindcss -i ./src/native.css -o ./dist/native.css --minify",
119
+ "build:aesthetics": "tailwindcss -i ./src/aesthetics/index.css -o ./dist/aesthetics/index.css --minify && tailwindcss -i ./src/aesthetics/neobrutalism.css -o ./dist/aesthetics/neobrutalism.css --minify && tailwindcss -i ./src/aesthetics/glass.css -o ./dist/aesthetics/glass.css --minify && tailwindcss -i ./src/aesthetics/pixel.css -o ./dist/aesthetics/pixel.css --minify && tailwindcss -i ./src/aesthetics/chunky-tile.css -o ./dist/aesthetics/chunky-tile.css --minify",
120
+ "build:tw": "node -e \"import('node:fs').then(fs => fs.cpSync('src', 'dist/tw', { recursive: true }))\"",
56
121
  "status:npm": "npm view @codenhub/styles version dist-tags time --json && npm dist-tag ls @codenhub/styles && npm access get status @codenhub/styles",
57
- "status:pack": "npm pack --dry-run",
58
- "test": "pnpm typecheck && pnpm test:build && pnpm test:visual",
59
- "test:build": "pnpm build && pnpm test:build:vanilla && pnpm test:build:tw",
60
- "test:build:tw": "tailwindcss -i ./tests/build/index.css -o ./tests/build/output.css --minify",
61
- "test:build:vanilla": "tailwindcss -i ./tests/vanilla/index.css -o ./tests/vanilla/output.css --minify",
62
- "test:visual": "playwright test",
63
- "test:watch": "playwright test --ui",
64
- "typecheck": "tsc --project tsconfig.json --noEmit"
122
+ "status:pack": "npm pack --dry-run --ignore-scripts",
123
+ "test": "vitest run",
124
+ "test:browser": "playwright test",
125
+ "test:browser:watch": "playwright test --ui",
126
+ "test:coverage": "pnpm test",
127
+ "test:watch": "vitest --watch",
128
+ "typecheck": "tsc -b"
65
129
  }
66
130
  }
package/docs/classes.md DELETED
@@ -1,198 +0,0 @@
1
- # @codenhub/styles Classes
2
-
3
- **Status:** IMPLEMENTED
4
- **Last updated:** 2026-06-18
5
- **Scope:** Public helper classes for `@codenhub/styles`.
6
-
7
- Helper classes are CSS-only. They provide presentation and state styling, not semantics or behavior.
8
-
9
- ## Layout
10
-
11
- `.stack`, `.cluster`, and `.auto-grid` are `@utility` classes. They are available in both the full stylesheet and the Tailwind source entrypoints, and participate in Tailwind's JIT pipeline.
12
-
13
- | Class | Purpose |
14
- | ------------------ | -------------------------------------------------------------- |
15
- | `.stack` | Vertical flex stack using `--layout-stack-gap`. |
16
- | `.stack.tight` | Smaller stack gap. |
17
- | `.stack.loose` | Larger stack gap. |
18
- | `.cluster` | Wrapping horizontal flex cluster using `--layout-cluster-gap`. |
19
- | `.cluster.between` | Cluster with `space-between` alignment. |
20
- | `.auto-grid` | Responsive auto-fit grid using `--layout-grid-min`. |
21
-
22
- ## Surfaces
23
-
24
- | Class | Purpose |
25
- | -------------- | --------------------------------------------- |
26
- | `.empty-state` | Centered empty-state layout with muted color. |
27
-
28
- ## Buttons
29
-
30
- Use `.btn` with one optional intent class, one optional presentation class, optional size class, and optional state.
31
-
32
- Intent classes map color tokens into button tone slots. Presentation classes own how those slots become background, text, border, hover, and spinner styles.
33
-
34
- Intent classes:
35
-
36
- | Class | Meaning |
37
- | ----------------------------------- | ------------------------------ |
38
- | `.primary` | Primary action. |
39
- | `.secondary` | Secondary/accent action. |
40
- | `.success` | Successful or positive action. |
41
- | `.warning` | Warning/caution action. |
42
- | `.destructive`, `.danger`, `.error` | Destructive or error action. |
43
- | `.info` | Informational action. |
44
-
45
- Presentation and size classes:
46
-
47
- | Class | Purpose |
48
- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
49
- | `.out` | Transparent button with intent readable-tone border and text. |
50
- | `.ghost` | Transparent button with intent readable-tone text and soft hover. |
51
- | `.soft` | Low-emphasis filled button using intent subtle surface and strong text tones. |
52
- | `.pill` | Fully rounded button corners (`border-radius: 9999px`). |
53
- | `.fill` with `.out` | Filled hover treatment using intent color and contrast text. |
54
- | `.sm` | Smaller button. |
55
- | `.lg` | Larger button. |
56
- | `.icon` | Square icon button. Use an accessible name in HTML. |
57
- | `.loading` | Loading state. Hides text and shows CSS activity indicator. |
58
- | `.disabled`, `[disabled]`, `[aria-disabled="true"]`, `[data-disabled]` | Disabled styling. |
59
-
60
- Examples:
61
-
62
- ```html
63
- <button class="btn primary">Primary</button>
64
- <button class="btn success out">Success outline</button>
65
- <button class="btn warning soft">Warning soft</button>
66
- <button class="btn destructive ghost">Danger ghost</button>
67
- <button class="btn icon primary" aria-label="Create">+</button>
68
- <button class="btn primary loading" disabled>Saving</button>
69
- ```
70
-
71
- `.loading` is a state, not a color or presentation class. Prefer combining it with disabled behavior so users cannot trigger duplicate work. Loading buttons keep only opacity and transform transitions active so spinner and surface colors stay synchronized when theme tokens change.
72
-
73
- ## Forms
74
-
75
- | Class or Selector | Purpose |
76
- | --------------------------------------------------------------------- | ----------------------------------- |
77
- | `.field` | Vertical field wrapper. |
78
- | `.label` | Form label text. |
79
- | `.hint` | Secondary helper text. |
80
- | `.error` inside `.field` except `.btn.error`, `.field-error` | Destructive helper text. |
81
- | `.ipt` | Input control styling. |
82
- | `.textarea` | Textarea control styling. |
83
- | `.select` | Select control styling. |
84
- | `input[type="checkbox"].checkbox` | Custom checkbox control styling. |
85
- | `input[type="checkbox"].switch` | Custom switch control styling. |
86
- | `[aria-invalid="true"]` on controls | Destructive border and focus color. |
87
- | `[disabled]`, `[aria-disabled="true"]`, `[data-disabled]` on controls | Disabled styling. |
88
-
89
- `.checkbox` and `.switch` accept the same intent classes as buttons to set the checked color:
90
-
91
- | Class | Meaning |
92
- | ----------------------------------- | ------------------ |
93
- | _(default)_ | Primary color. |
94
- | `.success` | Success color. |
95
- | `.warning` | Warning color. |
96
- | `.destructive`, `.danger`, `.error` | Destructive color. |
97
- | `.info` | Info color. |
98
-
99
- Example:
100
-
101
- ```html
102
- <label class="field">
103
- <span class="label">Email</span>
104
- <input class="ipt" type="email" aria-invalid="true" aria-describedby="email-error" />
105
- <span class="error" id="email-error">Enter a valid email.</span>
106
- </label>
107
- <label style="display: flex; gap: 0.5rem; align-items: center">
108
- <input type="checkbox" class="checkbox success" />
109
- <span>Accept terms</span>
110
- </label>
111
- <label style="display: flex; gap: 0.5rem; align-items: center">
112
- <input type="checkbox" class="switch destructive" />
113
- <span>Enable</span>
114
- </label>
115
- ```
116
-
117
- `.progress` also accepts the same intent classes to color the fill bar:
118
-
119
- ## Feedback
120
-
121
- | Class | Purpose |
122
- | ----------- | ------------------------------------------------------------------- |
123
- | `.alert` | Inline feedback surface. |
124
- | `.icon` | Subclass of `.alert`. Adds a corresponding intent icon and padding. |
125
- | `.badge` | Compact status pill. |
126
- | `.ai` | Low-level activity indicator. Applies CSS masking. |
127
- | `.loader` | Standalone inline loader. Composes `.ai` with visual styles. |
128
- | `.skeleton` | Ambient loading placeholder. |
129
- | `.progress` | Progress track. Fill element uses `--progress-value`. |
130
-
131
- Feedback helpers accept the same intent classes as buttons: `.success`, `.warning`, `.destructive`, `.danger`, `.error`, and `.info`.
132
-
133
- `.icon` is a subclass of `.alert`. When applied as `.alert.icon`, it increases the left padding and adds an embedded SVG icon matching the alert's intent (success, warning, error, info).
134
-
135
- `.badge` also accepts presentation variant classes:
136
-
137
- | Class | Purpose |
138
- | -------- | ---------------------------------------------------------------------------------- |
139
- | _(none)_ | Default. Tinted surface, intent-colored text, subtle intent-tinted border. |
140
- | `.flat` | Filled with the intent color; uses contrast text. Border matches the intent color. |
141
- | `.soft` | Tinted surface and intent-colored text with no border (border is transparent). |
142
-
143
- Examples:
144
-
145
- ```html
146
- <div class="alert success" role="status">Saved successfully.</div>
147
- <div class="alert success icon" role="status">Saved successfully with icon.</div>
148
- <span class="badge warning">Queued</span>
149
- <span class="badge success flat">Live</span>
150
- <span class="badge info soft">Draft</span>
151
- <span class="loader" aria-hidden="true"></span>
152
- <span class="loader dots-wave" aria-hidden="true"></span>
153
- <div class="progress" aria-label="Upload progress"><span style="--progress-value: 64%"></span></div>
154
- <div class="progress success" aria-label="Upload progress"><span style="--progress-value: 64%"></span></div>
155
- ```
156
-
157
- ## Tooltips
158
-
159
- | Class or Attribute | Purpose |
160
- | ---------------------------------- | ------------------------------------------------------------ |
161
- | `.tooltip` | Tooltip host. Uses `data-tooltip` as pseudo-element content. |
162
- | `.tooltip.tooltip-icon` | Circular icon-style tooltip host. |
163
- | `[data-tooltip-position="top"]` | Positions tooltip above host. |
164
- | `[data-tooltip-position="bottom"]` | Positions tooltip below host. |
165
- | `[data-tooltip-position="left"]` | Positions tooltip left of host. |
166
- | `[data-tooltip-position="right"]` | Positions tooltip right of host. |
167
- | No `data-tooltip-position` | Defaults to top placement. |
168
- | `[data-state="open"]` | Shows tooltip without hover. |
169
-
170
- Example:
171
-
172
- ```html
173
- <button
174
- class="tooltip tooltip-icon"
175
- data-tooltip="More details"
176
- data-tooltip-position="right"
177
- aria-label="More details"
178
- >
179
- ?
180
- </button>
181
- ```
182
-
183
- CSS pseudo-element tooltips are presentational. They are not a complete accessible tooltip implementation by themselves.
184
-
185
- ## Typography Utilities
186
-
187
- All typography classes and `.selection-contrast` are `@utility` classes.
188
-
189
- | Class | Purpose |
190
- | --------------------- | ------------------------------------------------------------ |
191
- | `.text-display` | Large display headings. |
192
- | `.text-title-lg` | Large section titles. |
193
- | `.text-title` | Default section titles. |
194
- | `.text-title-sm` | Smaller titles or card titles. |
195
- | `.text-label-lg` | Large label text. |
196
- | `.text-label` | Default label text. |
197
- | `.text-body` | Default body copy. |
198
- | `.selection-contrast` | Inverts `::selection` colors to primary-contrast background. |
package/docs/roadmap.md DELETED
@@ -1,34 +0,0 @@
1
- # Roadmap
2
-
3
- **Status:** APPROVED
4
- **Last updated:** 2026-06-23
5
- **Scope:** `@codenhub/styles` package direction.
6
-
7
- ## Purpose
8
-
9
- This roadmap tracks durable direction for `@codenhub/styles`. It captures styling-system improvements that should guide future changes without turning this document into a release checklist.
10
-
11
- ## Recently Completed
12
-
13
- - Published the v0.0.2 foundation: design tokens (colors, layout, radius, motion, focus, shadows, layering, dark mode), presentation/helper classes (buttons, forms, feedback, loaders, tooltips), accessibility contrast verification, and multi-path bundler visual regression tests.
14
-
15
- ## Planned
16
-
17
- - **Aesthetic Themes**: Add aesthetic themes (e.g., glassmorphism, brutalism, glitch) to allow changing the whole look-and-feel of the UI.
18
- - **Layout Helpers**: Expand layout helpers to support common page structure and flex/grid requirements.
19
- - **Dynamic Tokens & Color Schemes**: Add `@codenhub/theme` as a dev dependency to enable dynamic token changes and color scheme creation.
20
- - **Button Presentation Classes**: Consider adding more presentation classes for buttons (e.g., loading state enhancements) once component APIs stabilize.
21
- - **Compatibility Tests**: Add more explicit compatibility tests for intent and presentation combinations when new combinations are supported.
22
-
23
- ## Not Planned
24
-
25
- - **JS/TS Helpers**: Runtime DOM helpers (such as a typed `createElement` wrapper) are not planned for now. They will be considered further before any future package expansion, but remain out of scope for now to keep the package CSS-only.
26
- - Public JavaScript behavior like toast dismissal, focus management, and app-level theme state remain outside the CSS package.
27
-
28
- ## References
29
-
30
- - [Overview](./index.md)
31
- - [Tokens](./tokens.md)
32
- - [Classes](./classes.md)
33
- - [Accessibility](./accessibility.md)
34
- - [Tests](./tests.md)
package/docs/tests.md DELETED
@@ -1,128 +0,0 @@
1
- # Styles Test Strategy
2
-
3
- **Status:** APPROVED
4
- **Last updated:** 2026-06-16
5
- **Scope:** `@codenhub/styles` package test strategy.
6
-
7
- ## Goal
8
-
9
- Validate `@codenhub/styles` before publishing changes across both supported consumer paths:
10
-
11
- - Ready-to-import compiled CSS.
12
- - Tailwind CSS build-time source CSS.
13
-
14
- Keep tests package-local and focused on visual confidence plus build compatibility.
15
-
16
- ## Structure
17
-
18
- ```text
19
- packages/styles/
20
- tests/
21
- preview/
22
- vanilla/
23
- build/
24
- browser/
25
- scripts/
26
- ```
27
-
28
- ## `tests/preview`
29
-
30
- Shared manual and automated preview page for both supported consumer paths.
31
-
32
- Open with one of these URLs when running the package dev server:
33
-
34
- ```text
35
- http://localhost:5173/tests/preview/index.html?env=vanilla
36
- http://localhost:5173/tests/preview/index.html?env=build
37
- ```
38
-
39
- The page loads `tests/vanilla/output.css` for `env=vanilla` and `tests/build/output.css` for `env=build`.
40
-
41
- The floating environment toggle switches the `env` query value between `vanilla` and `build`. Its tooltip names the target environment with `See build` or `See vanilla`.
42
-
43
- Cover:
44
-
45
- - Tokens in light and dark mode.
46
- - Typography utilities.
47
- - Buttons: intent, presentation, disabled, and loading states.
48
- - Layout helpers, surfaces, forms, feedback, tooltips, and sections.
49
- - Selection and base styles.
50
- - Tailwind token utilities, dark variants, and responsive variants.
51
-
52
- Purpose: keep one HTML fixture while validating both real CSS outputs.
53
-
54
- ## `tests/vanilla`
55
-
56
- Compiled CSS output for vanilla consumers.
57
-
58
- Use built package CSS only:
59
-
60
- ```css
61
- @import "../../dist/index.css";
62
- ```
63
-
64
- Purpose: confirm canonical `@codenhub/styles` output looks right with no Tailwind consumer build.
65
-
66
- ## `tests/build`
67
-
68
- Build validation for Tailwind consumers.
69
-
70
- Use source entrypoint:
71
-
72
- ```css
73
- @import "tailwindcss";
74
- @import "@codenhub/styles/tw";
75
-
76
- @source "../preview/index.html";
77
- ```
78
-
79
- Cover:
80
-
81
- - Tailwind can process package source.
82
- - Token utilities work, such as `bg-background`, `text-text`, `font-default`.
83
- - Dark variant works with `.dark`.
84
- - Component classes build correctly.
85
- - Responsive token variants work.
86
-
87
- Purpose: confirm `@codenhub/styles/tw` works in consumer Tailwind builds.
88
-
89
- ## `tests/browser`
90
-
91
- Cross-browser automation for visual and computed-style confidence.
92
-
93
- Use Playwright by default.
94
-
95
- Tests load the same preview page twice with different `env` query values.
96
-
97
- Cover:
98
-
99
- - Chromium.
100
- - Firefox.
101
- - WebKit.
102
- - Page load assertions.
103
- - Key computed style assertions.
104
- - Optional screenshots for visual review.
105
-
106
- Purpose: catch browser-specific CSS regressions before publishing changes.
107
-
108
- ## Scripts
109
-
110
- Default package checks:
111
-
112
- ```json
113
- {
114
- "test": "pnpm typecheck && pnpm test:build && pnpm test:visual",
115
- "test:build": "pnpm build && pnpm test:build:vanilla && pnpm test:build:tw",
116
- "test:visual": "playwright test",
117
- "dev": "node ./scripts/dev.js"
118
- }
119
- ```
120
-
121
- `pnpm dev` starts a local static server and watches both CSS test builds.
122
-
123
- ## Priority
124
-
125
- 1. Keep `tests/preview` as the single shared HTML fixture.
126
- 2. Keep `tests/vanilla` for compiled CSS output.
127
- 3. Keep `tests/build` for Tailwind source build validation.
128
- 4. Keep `tests/browser` for Playwright cross-browser validation.