@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.
- package/LICENSE +201 -0
- package/NOTICE +52 -0
- package/README.md +60 -90
- package/dist/aesthetics/chunky-tile.css +1 -0
- package/dist/aesthetics/glass.css +1 -0
- package/dist/aesthetics/index.css +2 -0
- package/dist/aesthetics/neobrutalism.css +1 -0
- package/dist/aesthetics/pixel.css +1 -0
- package/dist/components.css +2 -2
- package/dist/index.css +2 -2
- package/dist/native.css +2 -0
- package/dist/theme.css +2 -2
- package/dist/tw/aesthetics/chunky-tile.css +107 -0
- package/dist/tw/aesthetics/glass.css +66 -0
- package/dist/tw/aesthetics/index.css +9 -0
- package/dist/tw/aesthetics/neobrutalism.css +63 -0
- package/dist/tw/aesthetics/pixel.css +88 -0
- package/dist/tw/box.css +185 -0
- package/dist/tw/components/button.css +88 -0
- package/dist/tw/components/feedback.css +163 -0
- package/dist/tw/components/form.css +601 -0
- package/dist/tw/components/index.css +18 -0
- package/dist/tw/components/loader.css +122 -0
- package/dist/tw/components/surface.css +98 -0
- package/dist/tw/components/tooltip.css +132 -0
- package/dist/tw/elevation.css +39 -0
- package/dist/tw/index.css +12 -0
- package/dist/tw/intent.css +189 -0
- package/dist/tw/native.css +203 -0
- package/dist/tw/presentation.css +77 -0
- package/dist/tw/reset.css +142 -0
- package/dist/tw/theme.css +218 -0
- package/dist/tw/typography.css +34 -0
- package/dist/tw/utilities/content.css +349 -0
- package/dist/tw/utilities/index.css +6 -0
- package/dist/tw/utilities/layout.css +107 -0
- package/docs/accessibility.md +43 -14
- package/docs/concepts.md +94 -0
- package/docs/index.md +62 -73
- package/docs/integrating/astro.md +29 -0
- package/docs/integrating/index.md +32 -0
- package/docs/integrating/nextjs.md +44 -0
- package/docs/integrating/svelte.md +37 -0
- package/docs/integrating/tailwind.md +40 -0
- package/docs/integrating/vue.md +25 -0
- package/docs/setup.md +116 -0
- package/docs/usage/aesthetics.md +197 -0
- package/docs/usage/buttons.md +74 -0
- package/docs/usage/composing.md +218 -0
- package/docs/usage/content-and-layout.md +200 -0
- package/docs/usage/customizing.md +213 -0
- package/docs/usage/feedback.md +117 -0
- package/docs/usage/forms.md +177 -0
- package/docs/usage/index.md +32 -0
- package/docs/usage/theming.md +210 -0
- package/docs/usage/tooltips.md +45 -0
- package/llms-full.txt +2122 -0
- package/llms.txt +26 -0
- package/package.json +96 -32
- package/docs/classes.md +0 -198
- package/docs/roadmap.md +0 -34
- package/docs/tests.md +0 -128
- package/docs/tokens.md +0 -101
- package/src/components/button.css +0 -155
- package/src/components/feedback.css +0 -214
- package/src/components/form.css +0 -296
- package/src/components/index.css +0 -9
- package/src/components/loader.css +0 -56
- package/src/components/surface.css +0 -6
- package/src/components/tooltip.css +0 -60
- package/src/index.css +0 -7
- package/src/overrides.css +0 -76
- package/src/theme.css +0 -136
- package/src/typography.css +0 -30
- package/src/utilities.css +0 -40
package/docs/index.md
CHANGED
|
@@ -1,73 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Aesthetic profile classes such as `.glassmorphism` or `.brutalism` are not part of v0.0.2. v0.0.2 provides the token foundation that makes them possible later.
|
|
64
|
-
|
|
65
|
-
## Documentation Map
|
|
66
|
-
|
|
67
|
-
| Document | Purpose |
|
|
68
|
-
| ----------------------------------- | --------------------------------------------------------- |
|
|
69
|
-
| [Tokens](./tokens.md) | Theme and foundation variable contracts. |
|
|
70
|
-
| [Classes](./classes.md) | Public helper class behavior and composition rules. |
|
|
71
|
-
| [Accessibility](./accessibility.md) | CSS accessibility hooks and responsibilities outside CSS. |
|
|
72
|
-
| [Tests](./tests.md) | Build and browser validation strategy. |
|
|
73
|
-
| [Roadmap](./roadmap.md) | Draft direction and durable planning context. |
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: What @codenhub/styles is, what it covers, and where to go next.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @codenhub/styles
|
|
7
|
+
|
|
8
|
+
`@codenhub/styles` is a CSS-only design system: tokens, a reset, typography and
|
|
9
|
+
layout utilities, and composable classes for buttons, forms, feedback,
|
|
10
|
+
surfaces, and tooltips. Every component separates three independent choices —
|
|
11
|
+
which color, how much of it, and what it's made of — so changing one never
|
|
12
|
+
requires a component-specific variant. Four optional aesthetics
|
|
13
|
+
(`.neobrutalism`, `.glass`, `.pixel`, `.chunky-tile`) restyle that same
|
|
14
|
+
component set without touching markup.
|
|
15
|
+
|
|
16
|
+
The package ships as ready-to-import compiled CSS, or as Tailwind CSS v4
|
|
17
|
+
source entrypoints for a project that already runs Tailwind. Both cover the
|
|
18
|
+
same classes; the difference is which build processes them.
|
|
19
|
+
|
|
20
|
+
## What it does
|
|
21
|
+
|
|
22
|
+
- Publishes color, foundation, intent, presentation, and material design
|
|
23
|
+
tokens as CSS custom properties, themed with `light-dark()`.
|
|
24
|
+
- Provides a reset, focus-visible handling, and responsive layout/content
|
|
25
|
+
utilities.
|
|
26
|
+
- Provides composable classes for buttons, form controls and toggles, alerts,
|
|
27
|
+
badges, loaders, progress, cards/panels, tables, quotes, code, and
|
|
28
|
+
tooltips.
|
|
29
|
+
- Provides four opt-in aesthetics that restyle the same components by setting
|
|
30
|
+
material tokens, not by adding component variants.
|
|
31
|
+
- Provides classless mappings so plain HTML elements pick up base styling
|
|
32
|
+
without added classes, from a dedicated entrypoint.
|
|
33
|
+
- Publishes Tailwind CSS v4 source entrypoints alongside the compiled output.
|
|
34
|
+
|
|
35
|
+
## What it does not do
|
|
36
|
+
|
|
37
|
+
- No JavaScript. There is no runtime, no framework bindings, and no build-time
|
|
38
|
+
code generation beyond the CSS itself.
|
|
39
|
+
- No semantic HTML, ARIA, keyboard behavior, focus management, validation, or
|
|
40
|
+
announcement timing. See [Accessibility](./accessibility.md) for the exact
|
|
41
|
+
line between what the CSS provides and what an application must still add.
|
|
42
|
+
- No theme-toggling logic. Theme selection is a class or attribute a consumer
|
|
43
|
+
applies; wiring a toggle to system preference, storage, or a user setting is
|
|
44
|
+
outside this package. The `@codenhub/theme` package covers that need for
|
|
45
|
+
consumers who want it.
|
|
46
|
+
- No shipped font binaries. `.pixel` and `.chunky-tile` accept a
|
|
47
|
+
consumer-supplied font and fall back to a system stack when none is given.
|
|
48
|
+
- No compatibility layer for removed tokens or classes. Breaking changes are
|
|
49
|
+
documented, not silently aliased.
|
|
50
|
+
|
|
51
|
+
## Next steps
|
|
52
|
+
|
|
53
|
+
- [Setup](./setup.md): Install the package, choose an entrypoint, and render a
|
|
54
|
+
first component.
|
|
55
|
+
- [Concepts](./concepts.md): The three-axis model, the token system, and how
|
|
56
|
+
theme selection works — read this before the usage guides.
|
|
57
|
+
- [Usage](./usage/index.md): Guides for composing axes, theming, customizing,
|
|
58
|
+
aesthetics, and each component family.
|
|
59
|
+
- [Integrating](./integrating/index.md): Wiring the stylesheet into Next.js,
|
|
60
|
+
Vue, Svelte, Astro, or a Tailwind CSS v4 build.
|
|
61
|
+
- [Accessibility](./accessibility.md): CSS accessibility hooks and what
|
|
62
|
+
remains an application responsibility.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Astro
|
|
3
|
+
description: Loading the stylesheet in an Astro app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Astro
|
|
7
|
+
|
|
8
|
+
Import the package from a shared layout's frontmatter so every page that
|
|
9
|
+
uses that layout loads it once:
|
|
10
|
+
|
|
11
|
+
```astro
|
|
12
|
+
---
|
|
13
|
+
// src/layouts/Layout.astro
|
|
14
|
+
import "@codenhub/styles";
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<html lang="en">
|
|
18
|
+
<body>
|
|
19
|
+
<slot />
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Apply `.dark` or `.light` on `<html>` to force a theme instead of following
|
|
25
|
+
the system preference; see [Setup → Configuration](../setup.md#configuration).
|
|
26
|
+
|
|
27
|
+
A project running Tailwind CSS v4 imports `@codenhub/styles/tw` through
|
|
28
|
+
Astro's Tailwind integration instead; see [Tailwind CSS v4](./tailwind.md)
|
|
29
|
+
for the `@source` directive Astro needs to scan `src/`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Integrating
|
|
3
|
+
description: Wiring the stylesheet into a framework or build target.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Integrating
|
|
7
|
+
|
|
8
|
+
This package has no JavaScript and no framework bindings; see
|
|
9
|
+
[Introduction](../index.md#what-it-does-not-do). Integrating it into a
|
|
10
|
+
framework is entirely about where that framework loads a global stylesheet,
|
|
11
|
+
and whether the project runs Tailwind CSS v4.
|
|
12
|
+
|
|
13
|
+
Every stack does the same two things:
|
|
14
|
+
|
|
15
|
+
1. Import one [entrypoint](../setup.md#import-paths) — the compiled
|
|
16
|
+
`@codenhub/styles` for any build, or `@codenhub/styles/tw` when the
|
|
17
|
+
project already runs Tailwind CSS v4 — from wherever that framework loads
|
|
18
|
+
global CSS.
|
|
19
|
+
2. Import `@codenhub/styles/aesthetics` (or `/tw/aesthetics`) after it, only
|
|
20
|
+
if the project uses an [aesthetic](../usage/aesthetics.md).
|
|
21
|
+
|
|
22
|
+
| Stack | Guide |
|
|
23
|
+
| ---------------------------------------- | -------------------------------- |
|
|
24
|
+
| A Tailwind CSS v4 project on any bundler | [Tailwind CSS v4](./tailwind.md) |
|
|
25
|
+
| Next.js / React | [Next.js](./nextjs.md) |
|
|
26
|
+
| Vue | [Vue](./vue.md) |
|
|
27
|
+
| Svelte / SvelteKit | [Svelte](./svelte.md) |
|
|
28
|
+
| Astro | [Astro](./astro.md) |
|
|
29
|
+
|
|
30
|
+
A project with no framework — a plain Vite, webpack, or Parcel build — needs
|
|
31
|
+
nothing beyond [Setup](../setup.md#quick-start): import the compiled
|
|
32
|
+
stylesheet from the project's existing global CSS entry.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Next.js
|
|
3
|
+
description: Loading the stylesheet in a Next.js / React app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Next.js
|
|
7
|
+
|
|
8
|
+
Next.js only allows global CSS to be imported from one place. Import the
|
|
9
|
+
package from the root layout in the App Router, or from the custom App in
|
|
10
|
+
the Pages Router — not from a page or component further down the tree.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
// app/layout.tsx
|
|
14
|
+
import "@codenhub/styles";
|
|
15
|
+
|
|
16
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
17
|
+
return (
|
|
18
|
+
<html lang="en">
|
|
19
|
+
<body>{children}</body>
|
|
20
|
+
</html>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
// pages/_app.tsx
|
|
27
|
+
import "@codenhub/styles";
|
|
28
|
+
import type { AppProps } from "next/app";
|
|
29
|
+
|
|
30
|
+
export default function App({ Component, pageProps }: AppProps) {
|
|
31
|
+
return <Component {...pageProps} />;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Apply `.dark` or `.light` on `<html>` to force a theme instead of following
|
|
36
|
+
the system preference; see [Setup → Configuration](../setup.md#configuration).
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<html lang="en" className="dark">
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
A project running Tailwind CSS v4 imports `@codenhub/styles/tw` from the
|
|
43
|
+
same file instead; see [Tailwind CSS v4](./tailwind.md) for the `@source`
|
|
44
|
+
directive Next.js needs to scan its own `app`/`src` directories.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Svelte
|
|
3
|
+
description: Loading the stylesheet in a Svelte / SvelteKit app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Svelte
|
|
7
|
+
|
|
8
|
+
In SvelteKit, import the package from the root layout so it loads once for
|
|
9
|
+
every route:
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<!-- src/routes/+layout.svelte -->
|
|
13
|
+
<script>
|
|
14
|
+
import "@codenhub/styles";
|
|
15
|
+
let { children } = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{@render children()}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
In a plain Svelte + Vite app, import it from the entry file instead:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// main.ts
|
|
25
|
+
import "@codenhub/styles";
|
|
26
|
+
import { mount } from "svelte";
|
|
27
|
+
import App from "./App.svelte";
|
|
28
|
+
|
|
29
|
+
mount(App, { target: document.getElementById("app")! });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Apply `.dark` or `.light` on `<html>` (edit `src/app.html` in SvelteKit) to
|
|
33
|
+
force a theme instead of following the system preference; see
|
|
34
|
+
[Setup → Configuration](../setup.md#configuration).
|
|
35
|
+
|
|
36
|
+
A project running Tailwind CSS v4 imports `@codenhub/styles/tw` from the
|
|
37
|
+
app's CSS entry instead; see [Tailwind CSS v4](./tailwind.md).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tailwind CSS v4
|
|
3
|
+
description: Using the /tw source entrypoints in a Tailwind CSS v4 project.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tailwind CSS v4
|
|
7
|
+
|
|
8
|
+
A project that already runs Tailwind CSS v4 can process this package's
|
|
9
|
+
source instead of its compiled output. `/tw` entrypoints publish copied,
|
|
10
|
+
uncompiled source from `dist/tw`; your own Tailwind build compiles it
|
|
11
|
+
alongside your app, so its `@theme`, `@utility`, and `@apply` directives
|
|
12
|
+
resolve together with yours.
|
|
13
|
+
|
|
14
|
+
```css
|
|
15
|
+
@import "tailwindcss";
|
|
16
|
+
@import "@codenhub/styles/tw";
|
|
17
|
+
|
|
18
|
+
@source "./src";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`@source` tells Tailwind's build where to scan for the utility and component
|
|
22
|
+
class names actually used in your markup, so it can generate only what is
|
|
23
|
+
referenced. Point it at your app's source, not at this package — `/tw`
|
|
24
|
+
already ships every class definition it publishes.
|
|
25
|
+
|
|
26
|
+
Add aesthetics from the source entrypoint the same way as the compiled one,
|
|
27
|
+
after the base import:
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
@import "tailwindcss";
|
|
31
|
+
@import "@codenhub/styles/tw";
|
|
32
|
+
@import "@codenhub/styles/tw/aesthetics";
|
|
33
|
+
|
|
34
|
+
@source "./src";
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Import a focused `/tw/*` entrypoint instead of the combined one — such as
|
|
38
|
+
`/tw/button` or `/tw/form` — when a build only needs one component family;
|
|
39
|
+
see the full [import path table](../setup.md#import-paths) for what each one
|
|
40
|
+
composes. Tailwind CSS 4 or newer is required for every `/tw` entrypoint.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Vue
|
|
3
|
+
description: Loading the stylesheet in a Vue / Vite app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Vue
|
|
7
|
+
|
|
8
|
+
Import the package once, from the app's entry file, before the app mounts:
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
// main.ts
|
|
12
|
+
import "@codenhub/styles";
|
|
13
|
+
import { createApp } from "vue";
|
|
14
|
+
import App from "./App.vue";
|
|
15
|
+
|
|
16
|
+
createApp(App).mount("#app");
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Apply `.dark` or `.light` on the root element to force a theme instead of
|
|
20
|
+
following the system preference; see
|
|
21
|
+
[Setup → Configuration](../setup.md#configuration).
|
|
22
|
+
|
|
23
|
+
A project running Tailwind CSS v4 imports `@codenhub/styles/tw` from a CSS
|
|
24
|
+
entry file instead of `main.ts`, using the `@tailwindcss/vite` plugin; see
|
|
25
|
+
[Tailwind CSS v4](./tailwind.md).
|
package/docs/setup.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Setup
|
|
3
|
+
description: Install the package, pick an entrypoint, and render a first component.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setup
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pnpm add @codenhub/styles
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
Import the compiled stylesheet for the complete token, reset, utility, and
|
|
17
|
+
component-class surface, then compose helper classes in markup:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@import "@codenhub/styles";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<main class="stack">
|
|
25
|
+
<p class="text-label">Status</p>
|
|
26
|
+
<h1 class="text-title">Ready to publish</h1>
|
|
27
|
+
<button class="btn primary">Continue</button>
|
|
28
|
+
</main>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The full stylesheet applies global reset and focus-visible rules, but does not
|
|
32
|
+
apply the optional classless native-element mappings, and does not include
|
|
33
|
+
aesthetics. Import focused entrypoints when global rules are not appropriate;
|
|
34
|
+
see [Import paths](#import-paths) below.
|
|
35
|
+
|
|
36
|
+
Aesthetics are opt-in. Import the combined aesthetics stylesheet, or one
|
|
37
|
+
aesthetic on its own, after the base stylesheet so its rules win:
|
|
38
|
+
|
|
39
|
+
```css
|
|
40
|
+
@import "@codenhub/styles";
|
|
41
|
+
@import "@codenhub/styles/aesthetics";
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<section class="neobrutalism">
|
|
46
|
+
<button class="btn primary">Thick ink and a hard shadow</button>
|
|
47
|
+
</section>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
A project already running Tailwind CSS v4 imports the source entrypoint
|
|
51
|
+
instead; see [Integrating → Tailwind CSS v4](./integrating/tailwind.md).
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
The root follows the operating-system color-scheme preference. Apply `.light`
|
|
56
|
+
or `.dark` to the root or any ancestor to force token values for that subtree.
|
|
57
|
+
`.theme-light`, `.theme-dark`, and `data-theme="light|dark"` are aliases.
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<html class="dark">
|
|
61
|
+
<body>
|
|
62
|
+
<button class="btn primary">Dark themed button</button>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
See [Concepts → Theme selection](./concepts.md#theme-selection) for how
|
|
68
|
+
selectors resolve and [Usage → Theming](./usage/theming.md) for the full color
|
|
69
|
+
token reference.
|
|
70
|
+
|
|
71
|
+
## Import paths
|
|
72
|
+
|
|
73
|
+
Compiled entrypoints are ready-to-import CSS and require only tooling that can
|
|
74
|
+
resolve package CSS imports. `/tw` entrypoints publish copied, uncompiled
|
|
75
|
+
source from `dist/tw`; a Tailwind v4 build must still process their `@theme`,
|
|
76
|
+
`@utility`, `@apply`, and related directives. Focused source component
|
|
77
|
+
entrypoints include theme tokens so their classes can work independently.
|
|
78
|
+
|
|
79
|
+
| Import path | Composition and effects |
|
|
80
|
+
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| `@codenhub/styles` | Compiled complete surface: Tailwind base/theme output, tokens, typography, utilities, components, and reset. Applies global reset, root theme, and focus rules. |
|
|
82
|
+
| `@codenhub/styles/theme` | Compiled Tailwind theme variables, Codenhub tokens, and the presentation classes. Sets root theme properties and system/explicit theme selectors; no reset or component classes. |
|
|
83
|
+
| `@codenhub/styles/components` | Compiled theme tokens, typography utilities, and every component class. Includes static reduced-motion loader masks; no reset, layout/content utilities, or native mappings. |
|
|
84
|
+
| `@codenhub/styles/native` | Compiled complete surface plus classless mappings for headings, text, content elements, form controls, and buttons. Applies the reset and broad element selectors. |
|
|
85
|
+
| `@codenhub/styles/aesthetics` | Compiled `.neobrutalism`, `.glass`, `.pixel`, and `.chunky-tile` classes. Adds no tokens or components of its own; import after the base stylesheet. |
|
|
86
|
+
| `@codenhub/styles/aesthetics/*` | One compiled aesthetic: `/neobrutalism`, `/glass`, `/pixel`, or `/chunky-tile`. Same rules and ordering as the combined file. |
|
|
87
|
+
| `@codenhub/styles/tw` | Source equivalent of the complete stylesheet. Imports Tailwind itself, theme, typography, utilities, components, and reset; applies the same global rules. |
|
|
88
|
+
| `@codenhub/styles/tw/theme` | Source theme, tokens, and presentation classes. Imports Tailwind's theme layer; emits root/system/explicit theme selectors and defines the package's custom `dark:` variant. |
|
|
89
|
+
| `@codenhub/styles/tw/components` | Published Tailwind source for theme, typography, buttons, feedback, forms, loaders, surfaces, and tooltips, including static reduced-motion loader masks. No reset, layout/content utilities, or native mappings. |
|
|
90
|
+
| `@codenhub/styles/tw/surface` | Source theme plus `.surface`, `.card`, and `.panel`. |
|
|
91
|
+
| `@codenhub/styles/tw/button` | Published Tailwind source for theme, activity indicators, and `.btn`; includes static reduced-motion masks because buttons compose `.loader-mask` for loading state. |
|
|
92
|
+
| `@codenhub/styles/tw/form` | Source theme plus field, public `text-control`, input, textarea, select, checkbox, radio, and switch utilities. |
|
|
93
|
+
| `@codenhub/styles/tw/feedback` | Source theme plus alert, badge, skeleton, and progress utilities and their keyframes. |
|
|
94
|
+
| `@codenhub/styles/tw/loader` | Published Tailwind source for activity indicators and loaders, including static reduced-motion masks. It has no theme or reset side effects and uses `currentColor`. |
|
|
95
|
+
| `@codenhub/styles/tw/tooltip` | Source theme plus tooltip utilities. |
|
|
96
|
+
| `@codenhub/styles/tw/reset` | Source theme, typography utilities, and global reset/accessibility rules. It changes root/body/elements and selection, motion, focus, scrollbar, and forced colors. |
|
|
97
|
+
| `@codenhub/styles/tw/native` | Source complete surface plus reset and classless native-element mappings; broadest global effects. |
|
|
98
|
+
| `@codenhub/styles/tw/typography` | Source theme plus typography utilities; sets theme selectors but no reset or classless mappings. |
|
|
99
|
+
| `@codenhub/styles/tw/utilities` | Source theme and typography composition plus layout and content utilities; safelists the package utility names. |
|
|
100
|
+
| `@codenhub/styles/tw/aesthetics` | Source aesthetics, combined. `/tw/aesthetics/neobrutalism`, `/glass`, `/pixel`, and `/chunky-tile` publish one apiece. Plain CSS with no theme or reset side effects. |
|
|
101
|
+
|
|
102
|
+
Avoid importing overlapping entrypoints in the same build unless duplicate
|
|
103
|
+
generated CSS is acceptable; pick the narrowest entrypoint that covers what a
|
|
104
|
+
page needs.
|
|
105
|
+
|
|
106
|
+
## Requirements
|
|
107
|
+
|
|
108
|
+
- Consumer tooling must resolve package CSS imports.
|
|
109
|
+
- Chrome 123, Safari 17.5, or Firefox 121 and newer. Color tokens are declared
|
|
110
|
+
with `light-dark()` and selected by `color-scheme` (Firefox 120), and
|
|
111
|
+
`.input-group` propagates a nested control's invalid and disabled state with
|
|
112
|
+
`:has()` (Firefox 121).
|
|
113
|
+
- Tailwind CSS 4 or newer is required only for `/tw` source entrypoints.
|
|
114
|
+
- The package has no JavaScript runtime. Apps must provide semantic HTML,
|
|
115
|
+
ARIA, keyboard behavior, focus management, validation, and announcements;
|
|
116
|
+
see [Accessibility](./accessibility.md).
|