@profullstack/css 0.0.0-stage → 0.2.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/AGENTS.md ADDED
@@ -0,0 +1,51 @@
1
+ # Profullstack CSS: agent usage contract
2
+
3
+ This file is the short, stable interface guide for coding agents working in a project that uses `@profullstack/css`.
4
+
5
+ ## First moves
6
+
7
+ 1. Read the nearby page and preserve its existing framework and conventions.
8
+ 2. Import `@profullstack/css` once from the app's global stylesheet.
9
+ 3. Build the page with semantic HTML and native controls first.
10
+ 4. Use only the layout classes, component classes, data attributes, and tokens listed in `css/manifest.json`.
11
+ 5. Keep behavior in the app. This package styles markup; it does not ship JavaScript.
12
+
13
+ ## Markup contract
14
+
15
+ - Use `main`, `nav`, `header`, `footer`, `section`, `article`, `form`, `label`, `button`, `a`, `table`, `details`, and other native elements according to their meaning.
16
+ - Use `<button>` for an action and `<a href>` for navigation. Never create clickable `div` elements.
17
+ - Give every form control a visible `<label>`. Connect hints and errors with `aria-describedby`; mark invalid fields with `aria-invalid="true"`.
18
+ - Keep a logical heading order. A page has one clear `h1`; section headings follow it.
19
+ - Put accessible status text in the document. Color and icons alone do not communicate state.
20
+ - Do not invent framework class names. If a pattern is missing, compose native elements and existing tokens, then document the addition in the project.
21
+
22
+ ## Supported layout vocabulary
23
+
24
+ `container`, `prose`, `stack`, `cluster`, `grid`, `split`, and `section` are the complete layout primitives. Use `data-space="sm|lg"` on `.stack` and `data-columns="2|3|4"` on `.grid` when needed. Add `data-rules` to `.grid` or `.cluster` for divider lines in the gaps, and `data-reveal` to `.grid`, `.stack`, or `.cluster` for a staggered scroll-in. Layouts adapt to narrow screens without breakpoint classes.
25
+
26
+ ## Supported component vocabulary
27
+
28
+ - `.card` for a bordered surface.
29
+ - `.button` for a link styled as a button; native `<button>` is already styled.
30
+ - `data-variant="secondary|ghost|danger"` for button variants.
31
+ - `.alert` with `role="status"` or `role="alert"` when appropriate; use `data-tone="success|warning|danger"` for status tone.
32
+ - `.badge` for a short label; use `data-tone="success|warning|danger"` when tone adds meaning.
33
+ - `.carousel` on a `<ul role="list">` of items for a horizontal scroll-snap row; the browser adds previous/next buttons and dot markers where supported.
34
+ - `[popover]` for a light surface opened by `<button popovertarget="id">`; add `data-anchor` (or `data-anchor="top|end"`) to place it next to that button.
35
+ - Native controls, tables, details/summary, progress, meter, and dialog elements receive baseline styling. Open dialogs with `<button commandfor="id" command="show-modal">`; add `closedby="any"` for light dismiss.
36
+
37
+ ## Platform layer
38
+
39
+ `css/platform.css` (imported automatically) adds the newest CSS to the same markup: themed `<select>` pickers, auto-growing textareas, `:user-invalid` errors, animated `<details>`, dialog and popover entry animations, scroll lock under a modal, anchored popovers, native carousel controls, gap decorations, scroll reveal, cross-document view transitions, and optical text trimming in buttons and badges. Every feature is guarded by `@supports` or a media query, so do not add fallbacks or JavaScript for them. Set `--pf-corner-shape: squircle|bevel|scoop|notch` to reshape every surface.
40
+
41
+ ## Tokens and themes
42
+
43
+ Use `--pf-*` custom properties from `css/tokens.css` for colors, spacing, type, borders, and radii. Do not hard-code a second palette. The default follows the operating system theme. Set `data-theme="light"` or `data-theme="dark"` on `<html>` to choose explicitly.
44
+
45
+ ## Accessibility and behavior
46
+
47
+ Keep keyboard focus visible. Preserve native keyboard behavior. Respect `prefers-reduced-motion`. Do not imply that CSS opens dialogs, validates forms, submits data, or makes a navigation menu interactive; implement those behaviors with native HTML or application code.
48
+
49
+ ## Machine-readable reference
50
+
51
+ For exact spellings and snippets, read `css/manifest.json`. For the complete human guide, read `docs/agent-guide.md` and `README.md`.
package/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0 — 2026-12-02
4
+
5
+ Platform layer: the newest CSS on the same semantic markup, all progressive enhancement.
6
+
7
+ - Add `css/platform.css` in a new `pf.platform` cascade layer, imported by default and exported as `@profullstack/css/platform`.
8
+ - Theme single `<select>` controls with `appearance: base-select`; grow `<textarea>` elements without `rows` via `field-sizing: content`; show errors with `:user-invalid`.
9
+ - Animate `<details>` height, dialog and popover entry and exit (`@starting-style`), and lock page scroll while a modal dialog is open.
10
+ - Style `[popover]`, and anchor `[popover][data-anchor]` to its invoking button with flip fallbacks.
11
+ - Add `.carousel`: scroll snap everywhere, native `::scroll-button` and `::scroll-marker` controls where supported.
12
+ - Add `data-rules` (CSS gap decorations) on `.grid` and `.cluster`, and `data-reveal` scroll-in staggered by `sibling-index()`.
13
+ - Cross-fade same-origin navigations with `@view-transition`; trim button and badge text to cap height; add `hanging-punctuation` in prose.
14
+ - Add `--pf-corner-shape` and `--pf-carousel-item` tokens.
15
+ - Fix `.badge` stretching to full width inside `.stack`.
16
+ - Add `examples/platform.html`; manifest contract 1.1.0.
17
+
18
+ ## 0.1.0 — 2026-10-30
19
+
20
+ Initial source release.
21
+
22
+ - Add semantic CSS defaults, layout primitives, native controls, and reusable patterns.
23
+ - Add light and dark color tokens, reduced-motion support, and visible keyboard focus.
24
+ - Add a machine-readable framework manifest, token catalog, and agent usage contract.
25
+ - Add launch page, rendered documentation, and example interfaces.
26
+ - Publish under the MIT license.
27
+
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Profullstack
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,125 @@
1
- # Temporary Holding Version
1
+ # @profullstack/css
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **A calmer CSS contract for people and agents.**
4
+
5
+ Project and source: https://github.com/profullstack/css
6
+
7
+ Build accessible, responsive interfaces from semantic HTML. Get useful defaults for type, forms, tables, buttons, cards, and color themes without shipping a JavaScript runtime or learning a sprawling class vocabulary.
8
+
9
+ > Small vocabulary. Native HTML. Interfaces that stay readable after the first draft.
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ npm install @profullstack/css
15
+ ```
16
+
17
+ ```css
18
+ @import "@profullstack/css";
19
+ ```
20
+
21
+ Or use the stylesheet directly from a CDN:
22
+
23
+ ```html
24
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@profullstack/css/css/profullstack.css">
25
+ ```
26
+
27
+ ## What you get
28
+
29
+ - Semantic elements with considered defaults, plus seven predictable layout primitives.
30
+ - Light and dark palettes that follow `prefers-color-scheme`, with explicit theme overrides.
31
+ - Useful styles for forms, buttons, tables, disclosures, dialogs, status messages, and cards.
32
+ - Visible keyboard focus and reduced-motion support.
33
+ - CSS custom properties for product-level branding.
34
+ - A machine-readable manifest and an `AGENTS.md` generation contract.
35
+ - A platform layer with the newest CSS on the same markup: themed `<select>`, auto-growing textareas, animated `<details>` and dialogs, anchored popovers, a no-script carousel, gap rules, scroll reveal, view transitions, and squircle corners. Each one is progressive enhancement.
36
+ - No JavaScript, build step, or runtime dependencies.
37
+
38
+ ## Quick start
39
+
40
+ ```html
41
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@profullstack/css/css/profullstack.css">
42
+
43
+ <main class="container stack section">
44
+ <header class="stack" data-space="sm">
45
+ <p class="eyebrow">Project overview</p>
46
+ <h1>Make the next step obvious.</h1>
47
+ <p class="muted">A short, useful description belongs here.</p>
48
+ </header>
49
+
50
+ <section class="grid" data-columns="2" aria-label="Project status">
51
+ <article class="card stack" data-space="sm">
52
+ <h2>Build quality</h2>
53
+ <p>All checks are passing.</p>
54
+ <span class="badge" data-tone="success">Healthy</span>
55
+ </article>
56
+ <article class="card stack" data-space="sm">
57
+ <h2>Next review</h2>
58
+ <p>Thursday at 10:30 AM.</p>
59
+ <a class="button" href="/reviews">Open review</a>
60
+ </article>
61
+ </section>
62
+ </main>
63
+ ```
64
+
65
+ ## Agent-ready by design
66
+
67
+ The framework publishes a finite vocabulary instead of asking code generators to guess. Read `AGENTS.md` for the short contract and `css/manifest.json` for exact class names, data attributes, snippets, theme rules, and accessibility guidance. When a pattern is missing, compose native elements and existing tokens; keep behavior in your app.
68
+
69
+ ## Customize
70
+
71
+ Override tokens after importing the framework:
72
+
73
+ ```css
74
+ :root {
75
+ --pf-color-primary: #4a42c4;
76
+ --pf-color-primary-hover: #3932a5;
77
+ --pf-radius-md: 1rem;
78
+ --pf-content-width: 78rem;
79
+ }
80
+ ```
81
+
82
+ To select a theme explicitly, set an attribute on the root element:
83
+
84
+ ```html
85
+ <html lang="en" data-theme="dark">
86
+ ```
87
+
88
+ Available theme values: `light`, `dark`. Without an attribute, the user's system preference wins.
89
+
90
+ ## Platform layer
91
+
92
+ `css/platform.css` is imported by default and upgrades native markup where the browser supports it. Older browsers keep the baseline, and nothing depends on JavaScript.
93
+
94
+ | Feature | Markup | CSS behind it |
95
+ | --- | --- | --- |
96
+ | Themed select picker | `<select>` | `appearance: base-select`, `::picker(select)` |
97
+ | Auto-growing textarea | `<textarea>` without `rows` | `field-sizing: content` |
98
+ | Errors after interaction | `required`, `type="email"`, … | `:user-invalid` |
99
+ | Animated disclosure | `<details>` | `::details-content`, `interpolate-size` |
100
+ | Animated dialog + scroll lock | `<dialog>` with `commandfor`, `closedby="any"` | `@starting-style`, `allow-discrete`, `:has(dialog:modal)` |
101
+ | Anchored popover | `<div popover data-anchor>` | anchor positioning, `position-try-fallbacks` |
102
+ | Carousel | `<ul class="carousel">` | scroll snap, `::scroll-button`, `::scroll-marker` |
103
+ | Gap rules | `.grid[data-rules]`, `.cluster[data-rules]` | CSS gap decorations |
104
+ | Scroll reveal | `[data-reveal]` | `animation-timeline: view()`, `sibling-index()` |
105
+ | Page cross-fade | same-origin links | `@view-transition` |
106
+ | Optical centring | buttons, badges | `text-box: trim-both cap alphabetic` |
107
+ | Corner shapes | `--pf-corner-shape: squircle` | `corner-shape` |
108
+
109
+ See `examples/platform.html` for all of them on one page.
110
+
111
+ ## Documentation
112
+
113
+ - `docs/agent-guide.md` — complete generation and usage guide.
114
+ - `css/manifest.json` — machine-readable framework contract.
115
+ - `docs/tokens.json` — token values and theme pairs for tooling.
116
+ - `examples/` — complete sample pages.
117
+ - `docs/index.html` — rendered documentation.
118
+
119
+ ## Scope
120
+
121
+ This is a CSS foundation, not a component runtime. It styles native `<dialog>` and form controls but does not open dialogs, validate inputs, submit forms, or implement menus. Use semantic HTML and add application behavior where it belongs.
122
+
123
+ ## License
124
+
125
+ MIT. Independent implementation; not affiliated with Pico CSS.
@@ -0,0 +1,223 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "name": "@profullstack/css",
4
+ "contractVersion": "1.1.0",
5
+ "description": "A semantic-first CSS contract for people and code-generating agents.",
6
+ "entrypoints": {
7
+ "default": "@profullstack/css",
8
+ "tokens": "@profullstack/css/tokens",
9
+ "manifest": "@profullstack/css/manifest",
10
+ "platform": "@profullstack/css/platform"
11
+ },
12
+ "agentGuide": "AGENTS.md",
13
+ "principles": [
14
+ "Use native HTML elements before adding classes.",
15
+ "Use documented classes and data attributes only.",
16
+ "Use real buttons for actions and links for navigation.",
17
+ "Keep labels, accessible names, and status text in the markup.",
18
+ "Use the provided design tokens for custom styling."
19
+ ],
20
+ "layout": {
21
+ "container": {
22
+ "class": "container",
23
+ "purpose": "Centered responsive page width."
24
+ },
25
+ "prose": {
26
+ "class": "prose",
27
+ "purpose": "Readable measure for long text."
28
+ },
29
+ "stack": {
30
+ "class": "stack",
31
+ "attributes": {
32
+ "data-space": [
33
+ "sm",
34
+ "lg"
35
+ ]
36
+ },
37
+ "purpose": "Vertical flow with consistent gaps."
38
+ },
39
+ "cluster": {
40
+ "class": "cluster",
41
+ "purpose": "Wrapping horizontal group with aligned items.",
42
+ "attributes": {
43
+ "data-rules": [
44
+ ""
45
+ ]
46
+ }
47
+ },
48
+ "grid": {
49
+ "class": "grid",
50
+ "attributes": {
51
+ "data-columns": [
52
+ "2",
53
+ "3",
54
+ "4"
55
+ ],
56
+ "data-rules": [
57
+ ""
58
+ ]
59
+ },
60
+ "purpose": "Responsive card or content grid.",
61
+ "notes": "data-rules draws lines in the gaps (CSS gap decorations) where supported."
62
+ },
63
+ "split": {
64
+ "class": "split",
65
+ "purpose": "Two-column content that collapses on small screens."
66
+ },
67
+ "section": {
68
+ "class": "section",
69
+ "purpose": "Responsive vertical section spacing."
70
+ }
71
+ },
72
+ "components": {
73
+ "button": {
74
+ "elements": [
75
+ "button",
76
+ "a.button"
77
+ ],
78
+ "variants": [
79
+ "secondary",
80
+ "ghost",
81
+ "danger"
82
+ ],
83
+ "example": "<button type=\"button\" data-variant=\"secondary\">Cancel</button>"
84
+ },
85
+ "card": {
86
+ "class": "card",
87
+ "example": "<article class=\"card stack\"><h2>Heading</h2><p>Supporting text.</p></article>"
88
+ },
89
+ "alert": {
90
+ "class": "alert",
91
+ "tones": [
92
+ "info",
93
+ "success",
94
+ "warning",
95
+ "danger"
96
+ ],
97
+ "example": "<p class=\"alert\" role=\"status\">Changes saved.</p>"
98
+ },
99
+ "badge": {
100
+ "class": "badge",
101
+ "tones": [
102
+ "neutral",
103
+ "success",
104
+ "warning",
105
+ "danger"
106
+ ],
107
+ "example": "<span class=\"badge\" data-tone=\"success\">Active</span>"
108
+ },
109
+ "form": {
110
+ "nativeElements": [
111
+ "label",
112
+ "input",
113
+ "select",
114
+ "textarea",
115
+ "fieldset",
116
+ "legend"
117
+ ],
118
+ "validation": "Set aria-invalid=\"true\" for server-side errors. Fields also turn red via :user-invalid after the person interacts. A textarea without rows grows with its content.",
119
+ "select": "A single <select> gets a themed picker (appearance: base-select) where supported."
120
+ },
121
+ "disclosure": {
122
+ "elements": [
123
+ "details",
124
+ "summary"
125
+ ],
126
+ "example": "<details><summary>More details</summary><p>Additional information.</p></details>",
127
+ "behavior": "Opens and closes with a height animation where ::details-content and interpolate-size are supported."
128
+ },
129
+ "table": {
130
+ "elements": [
131
+ "table",
132
+ "caption",
133
+ "thead",
134
+ "tbody",
135
+ "th",
136
+ "td"
137
+ ],
138
+ "rule": "Use a caption and scope row or column header cells."
139
+ },
140
+ "dialog": {
141
+ "element": "dialog",
142
+ "rule": "Open it with <button commandfor=\"id\" command=\"show-modal\"> or the dialog API; add closedby=\"any\" for light dismiss. It animates in and out, and page scroll locks while a modal is open."
143
+ },
144
+ "carousel": {
145
+ "class": "carousel",
146
+ "elements": [
147
+ "ul.carousel > li"
148
+ ],
149
+ "tokens": [
150
+ "--pf-carousel-item"
151
+ ],
152
+ "purpose": "Horizontal scroll-snap row; native previous/next buttons and dot markers via ::scroll-button and ::scroll-marker where supported. No JavaScript.",
153
+ "example": "<ul class=\"carousel\" role=\"list\" aria-label=\"Highlights\"><li class=\"card\">One</li><li class=\"card\">Two</li></ul>"
154
+ },
155
+ "popover": {
156
+ "attribute": "popover",
157
+ "values": [
158
+ "auto",
159
+ "manual",
160
+ "hint"
161
+ ],
162
+ "attributes": {
163
+ "data-anchor": [
164
+ "",
165
+ "top",
166
+ "end"
167
+ ]
168
+ },
169
+ "rule": "Open with popovertarget or commandfor on a <button>. data-anchor places it next to that button (CSS anchor positioning) and flips when space runs out; otherwise it is centred.",
170
+ "example": "<button type=\"button\" popovertarget=\"help\">Help</button><div id=\"help\" popover data-anchor>Short help.</div>"
171
+ }
172
+ },
173
+ "tokens": {
174
+ "file": "css/tokens.css",
175
+ "prefix": "--pf-",
176
+ "groups": [
177
+ "color",
178
+ "shadow",
179
+ "radius",
180
+ "space",
181
+ "font",
182
+ "text",
183
+ "leading",
184
+ "content",
185
+ "control",
186
+ "transition",
187
+ "corner"
188
+ ],
189
+ "shape": {
190
+ "--pf-corner-shape": [
191
+ "round",
192
+ "squircle",
193
+ "bevel",
194
+ "scoop",
195
+ "notch"
196
+ ]
197
+ }
198
+ },
199
+ "themes": {
200
+ "automatic": "Follows prefers-color-scheme.",
201
+ "light": "Set data-theme=\"light\" on the html element.",
202
+ "dark": "Set data-theme=\"dark\" on the html element."
203
+ },
204
+ "behavior": {
205
+ "javascriptIncluded": false,
206
+ "runtimeDependencies": [],
207
+ "motionPreference": "Respects prefers-reduced-motion.",
208
+ "focus": "Provides visible :focus-visible outlines.",
209
+ "progressiveEnhancement": "Every platform-layer feature is guarded by @supports or a media query; unsupported browsers get the 0.1 baseline."
210
+ },
211
+ "motion": {
212
+ "reveal": {
213
+ "attribute": "data-reveal",
214
+ "on": [
215
+ ".grid",
216
+ ".stack",
217
+ ".cluster"
218
+ ],
219
+ "purpose": "Children fade up as they scroll into view, staggered by sibling-index(). Off under prefers-reduced-motion."
220
+ },
221
+ "viewTransitions": "Same-origin page navigations cross-fade (@view-transition). Disable with @view-transition { navigation: none; } in app CSS."
222
+ }
223
+ }