@poppyui/core 0.1.0 → 0.1.1
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 +21 -21
- package/README.md +166 -166
- package/dist/components/accordion.css +1 -1
- package/dist/components/button.css +3 -3
- package/dist/components/checkbox.css +1 -1
- package/dist/components/drawer.css +4 -4
- package/dist/components/dropdown.css +3 -3
- package/dist/components/input.css +1 -1
- package/dist/components/modal.css +6 -6
- package/dist/components/progress.css +1 -1
- package/dist/components/skeleton.css +1 -1
- package/dist/components/stat.css +1 -1
- package/dist/components/tabs.css +2 -2
- package/dist/components/toast.css +2 -2
- package/dist/components/toggle.css +1 -1
- package/dist/poppy.css +27 -27
- package/package.json +53 -53
- package/src/base/base.css +40 -40
- package/src/components/accordion.css +98 -98
- package/src/components/alert.css +58 -58
- package/src/components/avatar.css +67 -67
- package/src/components/badge.css +87 -87
- package/src/components/breadcrumbs.css +68 -68
- package/src/components/button.css +139 -139
- package/src/components/card.css +87 -87
- package/src/components/checkbox.css +77 -77
- package/src/components/divider.css +46 -46
- package/src/components/drawer.css +84 -84
- package/src/components/dropdown.css +100 -100
- package/src/components/field.css +71 -71
- package/src/components/input.css +127 -127
- package/src/components/join.css +70 -70
- package/src/components/kbd.css +35 -35
- package/src/components/loading.css +74 -74
- package/src/components/menu.css +147 -147
- package/src/components/modal.css +83 -83
- package/src/components/navbar.css +54 -54
- package/src/components/progress.css +91 -91
- package/src/components/radio.css +65 -65
- package/src/components/range.css +83 -83
- package/src/components/skeleton.css +43 -43
- package/src/components/stat.css +54 -54
- package/src/components/steps.css +100 -100
- package/src/components/table.css +65 -65
- package/src/components/tabs.css +125 -125
- package/src/components/toast.css +80 -80
- package/src/components/toggle.css +76 -76
- package/src/components/tooltip.css +59 -59
- package/src/core.css +7 -7
- package/src/poppy.css +34 -34
- package/src/themes/dark.css +31 -31
- package/src/themes/light.css +32 -32
- package/src/tokens/tokens.css +52 -52
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Shashikanth Kota
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shashikanth Kota
|
|
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,166 +1,166 @@
|
|
|
1
|
-
# PoppyUI
|
|
2
|
-
|
|
3
|
-
A framework-agnostic, CSS-first design system. You put semantic classes on plain HTML (`.btn`, `.modal`, `.dropdown`), and the browser supplies the behavior: `<dialog>`, `popover`, Invoker Commands and CSS anchor positioning. PoppyUI ships **zero JavaScript** and has **no runtime dependencies**.
|
|
4
|
-
|
|
5
|
-
It works in plain HTML, React, Angular, Vue, Svelte and SSR, and consumers need no build step.
|
|
6
|
-
|
|
7
|
-
## 30-second quickstart
|
|
8
|
-
|
|
9
|
-
### Plain HTML (CDN)
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@poppyui/core/dist/poppy.min.css" />
|
|
13
|
-
|
|
14
|
-
<button class="btn btn-primary" commandfor="hello" command="show-modal">Say hi</button>
|
|
15
|
-
|
|
16
|
-
<dialog id="hello" class="modal" aria-labelledby="hello-title" closedby="any">
|
|
17
|
-
<h2 id="hello-title" class="modal-title">Hi 👋</h2>
|
|
18
|
-
<p>No JavaScript was harmed in the making of this modal.</p>
|
|
19
|
-
<div class="modal-actions">
|
|
20
|
-
<button class="btn" commandfor="hello" command="close">Close</button>
|
|
21
|
-
</div>
|
|
22
|
-
</dialog>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### React
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
pnpm add @poppyui/core
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
```jsx
|
|
32
|
-
import "@poppyui/core";
|
|
33
|
-
|
|
34
|
-
export function DeleteButton() {
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
<button className="btn btn-danger" commandfor="confirm" command="show-modal">Delete</button>
|
|
38
|
-
<dialog id="confirm" className="modal" aria-labelledby="confirm-title">
|
|
39
|
-
<h2 id="confirm-title" className="modal-title">Are you sure?</h2>
|
|
40
|
-
<div className="modal-actions">
|
|
41
|
-
<button className="btn" commandfor="confirm" command="close">Cancel</button>
|
|
42
|
-
</div>
|
|
43
|
-
</dialog>
|
|
44
|
-
</>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
React 19 passes unknown lowercase attributes like `commandfor` straight to the DOM. If your TypeScript setup complains about them, add them to `JSX.IntrinsicElements` or spread them in as an object.
|
|
50
|
-
|
|
51
|
-
### Angular
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
pnpm add @poppyui/core
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Add the CSS in `angular.json` under `projects.<app>.architect.build.options.styles`:
|
|
58
|
-
|
|
59
|
-
```json
|
|
60
|
-
"styles": ["node_modules/@poppyui/core/dist/poppy.css", "src/styles.css"]
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
```html
|
|
64
|
-
<button class="btn btn-primary" popovertarget="menu">Options</button>
|
|
65
|
-
<div id="menu" class="dropdown" popover>
|
|
66
|
-
<ul class="dropdown-menu">
|
|
67
|
-
<li><button type="button">Edit</button></li>
|
|
68
|
-
</ul>
|
|
69
|
-
</div>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Angular binds unknown attributes as-is in templates. For dynamic values, use `[attr.commandfor]="id"`.
|
|
73
|
-
|
|
74
|
-
### Font: Poppins
|
|
75
|
-
|
|
76
|
-
PoppyUI's font stack starts with [Poppins](https://fonts.google.com/specimen/Poppins). The font is **not bundled**, so the shipped CSS makes no third-party requests. Load it yourself:
|
|
77
|
-
|
|
78
|
-
```html
|
|
79
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
80
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
81
|
-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" />
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
You can also self-host it. Without Poppins, text falls back to the system UI font. To use another font, override `--font-sans`.
|
|
85
|
-
|
|
86
|
-
## Cherry-picking components
|
|
87
|
-
|
|
88
|
-
```css
|
|
89
|
-
@import "@poppyui/core/core.css"; /* tokens, themes, base */
|
|
90
|
-
@import "@poppyui/core/components/button.css"; /* only what you use */
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Themes
|
|
94
|
-
|
|
95
|
-
Light is the default. Set `data-theme="dark"` (or `"light"`) on **any** element, and that subtree switches theme. Themes nest.
|
|
96
|
-
|
|
97
|
-
```html
|
|
98
|
-
<html data-theme="dark">…</html>
|
|
99
|
-
<section data-theme="light">…</section>
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Overriding styles
|
|
103
|
-
|
|
104
|
-
Every PoppyUI rule lives in the `@layer poppy.*` layers (`poppy.tokens`, `poppy.base`, `poppy.components`). Any unlayered CSS you write wins without `!important`:
|
|
105
|
-
|
|
106
|
-
```css
|
|
107
|
-
.btn { border-radius: 0; } /* beats PoppyUI */
|
|
108
|
-
:root { --color-primary: oklch(55% 0.2 150); } /* rebrand */
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Components
|
|
112
|
-
|
|
113
|
-
| Component | Markup | Options |
|
|
114
|
-
| --- | --- | --- |
|
|
115
|
-
| Button | `<button class="btn">` | `btn-primary` `btn-secondary` `btn-ghost` `btn-outline` `btn-danger` · `btn-sm` `btn-lg` · `btn-loading` (+ `aria-busy="true"`) · `:disabled` |
|
|
116
|
-
| Modal | `<dialog class="modal">` + `<button commandfor="id" command="show-modal">` | `.modal-title`, `.modal-actions`, `closedby="any"` for click-outside to close |
|
|
117
|
-
| Dropdown | `<div class="dropdown" popover>` + `<button popovertarget="id">` (or `commandfor` + `command="toggle-popover"`) | `.dropdown-menu` list |
|
|
118
|
-
|
|
119
|
-
## Browser support
|
|
120
|
-
|
|
121
|
-
Statuses are from [web.dev Baseline](https://web.dev/baseline) / MDN, checked November 2026.
|
|
122
|
-
|
|
123
|
-
| Feature | Used for | Baseline status |
|
|
124
|
-
| --- | --- | --- |
|
|
125
|
-
| `<dialog>`, `showModal()`, `::backdrop` | Modal, focus trap, Esc | ✅ Widely available |
|
|
126
|
-
| Cascade layers (`@layer`) | Consumer CSS wins without `!important` | ✅ Widely available |
|
|
127
|
-
| `oklch()` | Color tokens | ✅ Widely available |
|
|
128
|
-
| `color-mix()` | Button hover | ✅ Widely available |
|
|
129
|
-
| CSS nesting | Source authoring (shipped as-is) | ✅ Widely available |
|
|
130
|
-
| Individual transforms (`translate`, `scale`) | Animations | ✅ Widely available |
|
|
131
|
-
| Popover API (`popover`, `popovertarget`) | Dropdown, toast, light dismiss | 🟦 Newly available (2025) |
|
|
132
|
-
| `@starting-style` | Enter animations | 🟦 Newly available (2024) |
|
|
133
|
-
| `transition-behavior: allow-discrete` | Exit animations | 🟦 Newly available (2024) |
|
|
134
|
-
| Invoker Commands (`commandfor` / `command`) | Opening the modal, drawer and dropdown with no JS | 🟦 Newly available (Dec 2025) |
|
|
135
|
-
| CSS anchor positioning | Dropdown placement | 🟦 Newly available (Jan 2026) |
|
|
136
|
-
| `:has()` | Field error messages, inline labels | ✅ Widely available |
|
|
137
|
-
| `:user-invalid` | Input and field validation styling | ✅ Widely available |
|
|
138
|
-
| Exclusive `<details name>` | Accordion | 🟦 Newly available (2024) |
|
|
139
|
-
| `::details-content`, `interpolate-size` | Accordion open/close animation | ⚠️ Limited (Chromium). Optional: without it the accordion opens instantly. |
|
|
140
|
-
| `appearance: base-select` | Customizable `.select` | ⚠️ Limited (Chromium). Optional: other browsers keep the native select with token colors. |
|
|
141
|
-
| `closedby` on `<dialog>` | Click outside to close the modal | ⚠️ Limited (not in Safari yet). Optional: Esc and close buttons still work. |
|
|
142
|
-
| `overlay` transition | Keeps the top layer during exit animations | ⚠️ Limited (Chromium). Optional: without it the exit animation is cut short. |
|
|
143
|
-
|
|
144
|
-
**Graceful degradation:**
|
|
145
|
-
|
|
146
|
-
- **No anchor positioning:** the dropdown opens as a sheet pinned to the bottom of the viewport. A top-layer popover cannot be placed relative to its trigger without JavaScript.
|
|
147
|
-
- **No Invoker Commands:** `commandfor` buttons do nothing. If you need older browsers, use `popovertarget` for dropdowns, or load an invokers polyfill yourself.
|
|
148
|
-
- **No `@starting-style`:** components appear without animating.
|
|
149
|
-
|
|
150
|
-
## Development
|
|
151
|
-
|
|
152
|
-
```sh
|
|
153
|
-
pnpm install
|
|
154
|
-
pnpm dev # test page at http://localhost:5173
|
|
155
|
-
pnpm build # dist/poppy.css, dist/poppy.min.css, dist/core.css, dist/components/*.css
|
|
156
|
-
pnpm test:install # once: Playwright Chromium
|
|
157
|
-
pnpm test # axe (light + dark) and keyboard tests
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
The Angular demo app lives in the separate repo `poppyui-dev/app`.
|
|
161
|
-
|
|
162
|
-
See [AGENTS.md](AGENTS.md) for contribution rules and [CHANGELOG.md](CHANGELOG.md) for changes.
|
|
163
|
-
|
|
164
|
-
## License
|
|
165
|
-
|
|
166
|
-
[MIT](LICENSE)
|
|
1
|
+
# PoppyUI
|
|
2
|
+
|
|
3
|
+
A framework-agnostic, CSS-first design system. You put semantic classes on plain HTML (`.btn`, `.modal`, `.dropdown`), and the browser supplies the behavior: `<dialog>`, `popover`, Invoker Commands and CSS anchor positioning. PoppyUI ships **zero JavaScript** and has **no runtime dependencies**.
|
|
4
|
+
|
|
5
|
+
It works in plain HTML, React, Angular, Vue, Svelte and SSR, and consumers need no build step.
|
|
6
|
+
|
|
7
|
+
## 30-second quickstart
|
|
8
|
+
|
|
9
|
+
### Plain HTML (CDN)
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@poppyui/core/dist/poppy.min.css" />
|
|
13
|
+
|
|
14
|
+
<button class="btn btn-primary" commandfor="hello" command="show-modal">Say hi</button>
|
|
15
|
+
|
|
16
|
+
<dialog id="hello" class="modal" aria-labelledby="hello-title" closedby="any">
|
|
17
|
+
<h2 id="hello-title" class="modal-title">Hi 👋</h2>
|
|
18
|
+
<p>No JavaScript was harmed in the making of this modal.</p>
|
|
19
|
+
<div class="modal-actions">
|
|
20
|
+
<button class="btn" commandfor="hello" command="close">Close</button>
|
|
21
|
+
</div>
|
|
22
|
+
</dialog>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### React
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pnpm add @poppyui/core
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
import "@poppyui/core";
|
|
33
|
+
|
|
34
|
+
export function DeleteButton() {
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<button className="btn btn-danger" commandfor="confirm" command="show-modal">Delete</button>
|
|
38
|
+
<dialog id="confirm" className="modal" aria-labelledby="confirm-title">
|
|
39
|
+
<h2 id="confirm-title" className="modal-title">Are you sure?</h2>
|
|
40
|
+
<div className="modal-actions">
|
|
41
|
+
<button className="btn" commandfor="confirm" command="close">Cancel</button>
|
|
42
|
+
</div>
|
|
43
|
+
</dialog>
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
React 19 passes unknown lowercase attributes like `commandfor` straight to the DOM. If your TypeScript setup complains about them, add them to `JSX.IntrinsicElements` or spread them in as an object.
|
|
50
|
+
|
|
51
|
+
### Angular
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
pnpm add @poppyui/core
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add the CSS in `angular.json` under `projects.<app>.architect.build.options.styles`:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
"styles": ["node_modules/@poppyui/core/dist/poppy.css", "src/styles.css"]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<button class="btn btn-primary" popovertarget="menu">Options</button>
|
|
65
|
+
<div id="menu" class="dropdown" popover>
|
|
66
|
+
<ul class="dropdown-menu">
|
|
67
|
+
<li><button type="button">Edit</button></li>
|
|
68
|
+
</ul>
|
|
69
|
+
</div>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Angular binds unknown attributes as-is in templates. For dynamic values, use `[attr.commandfor]="id"`.
|
|
73
|
+
|
|
74
|
+
### Font: Poppins
|
|
75
|
+
|
|
76
|
+
PoppyUI's font stack starts with [Poppins](https://fonts.google.com/specimen/Poppins). The font is **not bundled**, so the shipped CSS makes no third-party requests. Load it yourself:
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
80
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
81
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" />
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
You can also self-host it. Without Poppins, text falls back to the system UI font. To use another font, override `--font-sans`.
|
|
85
|
+
|
|
86
|
+
## Cherry-picking components
|
|
87
|
+
|
|
88
|
+
```css
|
|
89
|
+
@import "@poppyui/core/core.css"; /* tokens, themes, base */
|
|
90
|
+
@import "@poppyui/core/components/button.css"; /* only what you use */
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Themes
|
|
94
|
+
|
|
95
|
+
Light is the default. Set `data-theme="dark"` (or `"light"`) on **any** element, and that subtree switches theme. Themes nest.
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<html data-theme="dark">…</html>
|
|
99
|
+
<section data-theme="light">…</section>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Overriding styles
|
|
103
|
+
|
|
104
|
+
Every PoppyUI rule lives in the `@layer poppy.*` layers (`poppy.tokens`, `poppy.base`, `poppy.components`). Any unlayered CSS you write wins without `!important`:
|
|
105
|
+
|
|
106
|
+
```css
|
|
107
|
+
.btn { border-radius: 0; } /* beats PoppyUI */
|
|
108
|
+
:root { --color-primary: oklch(55% 0.2 150); } /* rebrand */
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Components
|
|
112
|
+
|
|
113
|
+
| Component | Markup | Options |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| Button | `<button class="btn">` | `btn-primary` `btn-secondary` `btn-ghost` `btn-outline` `btn-danger` · `btn-sm` `btn-lg` · `btn-loading` (+ `aria-busy="true"`) · `:disabled` |
|
|
116
|
+
| Modal | `<dialog class="modal">` + `<button commandfor="id" command="show-modal">` | `.modal-title`, `.modal-actions`, `closedby="any"` for click-outside to close |
|
|
117
|
+
| Dropdown | `<div class="dropdown" popover>` + `<button popovertarget="id">` (or `commandfor` + `command="toggle-popover"`) | `.dropdown-menu` list |
|
|
118
|
+
|
|
119
|
+
## Browser support
|
|
120
|
+
|
|
121
|
+
Statuses are from [web.dev Baseline](https://web.dev/baseline) / MDN, checked November 2026.
|
|
122
|
+
|
|
123
|
+
| Feature | Used for | Baseline status |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| `<dialog>`, `showModal()`, `::backdrop` | Modal, focus trap, Esc | ✅ Widely available |
|
|
126
|
+
| Cascade layers (`@layer`) | Consumer CSS wins without `!important` | ✅ Widely available |
|
|
127
|
+
| `oklch()` | Color tokens | ✅ Widely available |
|
|
128
|
+
| `color-mix()` | Button hover | ✅ Widely available |
|
|
129
|
+
| CSS nesting | Source authoring (shipped as-is) | ✅ Widely available |
|
|
130
|
+
| Individual transforms (`translate`, `scale`) | Animations | ✅ Widely available |
|
|
131
|
+
| Popover API (`popover`, `popovertarget`) | Dropdown, toast, light dismiss | 🟦 Newly available (2025) |
|
|
132
|
+
| `@starting-style` | Enter animations | 🟦 Newly available (2024) |
|
|
133
|
+
| `transition-behavior: allow-discrete` | Exit animations | 🟦 Newly available (2024) |
|
|
134
|
+
| Invoker Commands (`commandfor` / `command`) | Opening the modal, drawer and dropdown with no JS | 🟦 Newly available (Dec 2025) |
|
|
135
|
+
| CSS anchor positioning | Dropdown placement | 🟦 Newly available (Jan 2026) |
|
|
136
|
+
| `:has()` | Field error messages, inline labels | ✅ Widely available |
|
|
137
|
+
| `:user-invalid` | Input and field validation styling | ✅ Widely available |
|
|
138
|
+
| Exclusive `<details name>` | Accordion | 🟦 Newly available (2024) |
|
|
139
|
+
| `::details-content`, `interpolate-size` | Accordion open/close animation | ⚠️ Limited (Chromium). Optional: without it the accordion opens instantly. |
|
|
140
|
+
| `appearance: base-select` | Customizable `.select` | ⚠️ Limited (Chromium). Optional: other browsers keep the native select with token colors. |
|
|
141
|
+
| `closedby` on `<dialog>` | Click outside to close the modal | ⚠️ Limited (not in Safari yet). Optional: Esc and close buttons still work. |
|
|
142
|
+
| `overlay` transition | Keeps the top layer during exit animations | ⚠️ Limited (Chromium). Optional: without it the exit animation is cut short. |
|
|
143
|
+
|
|
144
|
+
**Graceful degradation:**
|
|
145
|
+
|
|
146
|
+
- **No anchor positioning:** the dropdown opens as a sheet pinned to the bottom of the viewport. A top-layer popover cannot be placed relative to its trigger without JavaScript.
|
|
147
|
+
- **No Invoker Commands:** `commandfor` buttons do nothing. If you need older browsers, use `popovertarget` for dropdowns, or load an invokers polyfill yourself.
|
|
148
|
+
- **No `@starting-style`:** components appear without animating.
|
|
149
|
+
|
|
150
|
+
## Development
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
pnpm install
|
|
154
|
+
pnpm dev # test page at http://localhost:5173
|
|
155
|
+
pnpm build # dist/poppy.css, dist/poppy.min.css, dist/core.css, dist/components/*.css
|
|
156
|
+
pnpm test:install # once: Playwright Chromium
|
|
157
|
+
pnpm test # axe (light + dark) and keyboard tests
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The Angular demo app lives in the separate repo `poppyui-dev/app`.
|
|
161
|
+
|
|
162
|
+
See [AGENTS.md](AGENTS.md) for contribution rules and [CHANGELOG.md](CHANGELOG.md) for changes.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
[MIT](LICENSE)
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
&::details-content {
|
|
71
71
|
block-size: 0;
|
|
72
|
-
transition: block-size var(--duration-normal) var(--ease-out),
|
|
72
|
+
transition: block-size var(--duration-normal) var(--ease-out),
|
|
73
73
|
content-visibility var(--duration-normal) allow-discrete;
|
|
74
74
|
overflow: clip;
|
|
75
75
|
}
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
white-space: nowrap;
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
user-select: none;
|
|
25
|
-
transition: background-color var(--duration-fast) var(--ease-out),
|
|
26
|
-
border-color var(--duration-fast) var(--ease-out),
|
|
27
|
-
color var(--duration-fast) var(--ease-out),
|
|
25
|
+
transition: background-color var(--duration-fast) var(--ease-out),
|
|
26
|
+
border-color var(--duration-fast) var(--ease-out),
|
|
27
|
+
color var(--duration-fast) var(--ease-out),
|
|
28
28
|
scale var(--duration-fast) var(--ease-out);
|
|
29
29
|
line-height: 1;
|
|
30
30
|
text-decoration: none;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
background: var(--color-base-100);
|
|
14
14
|
color: var(--chk-fg);
|
|
15
15
|
cursor: pointer;
|
|
16
|
-
transition: background-color var(--duration-fast) var(--ease-out),
|
|
16
|
+
transition: background-color var(--duration-fast) var(--ease-out),
|
|
17
17
|
border-color var(--duration-fast) var(--ease-out);
|
|
18
18
|
flex: none;
|
|
19
19
|
place-content: center;
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
box-shadow: var(--shadow-lg);
|
|
17
17
|
overscroll-behavior: contain;
|
|
18
18
|
translate: var(--drawer-shift) 0;
|
|
19
|
-
transition: translate var(--duration-normal) var(--ease-out),
|
|
20
|
-
overlay var(--duration-normal) allow-discrete,
|
|
19
|
+
transition: translate var(--duration-normal) var(--ease-out),
|
|
20
|
+
overlay var(--duration-normal) allow-discrete,
|
|
21
21
|
display var(--duration-normal) allow-discrete;
|
|
22
22
|
margin-inline-end: auto;
|
|
23
23
|
overflow: auto;
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
&::backdrop {
|
|
38
|
-
transition: background-color var(--duration-normal) var(--ease-out),
|
|
39
|
-
overlay var(--duration-normal) allow-discrete,
|
|
38
|
+
transition: background-color var(--duration-normal) var(--ease-out),
|
|
39
|
+
overlay var(--duration-normal) allow-discrete,
|
|
40
40
|
display var(--duration-normal) allow-discrete;
|
|
41
41
|
background-color: #0000;
|
|
42
42
|
}
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
box-shadow: var(--shadow-md);
|
|
13
13
|
opacity: 0;
|
|
14
14
|
translate: 0 calc(-1 * var(--space-1));
|
|
15
|
-
transition: opacity var(--duration-fast) var(--ease-out),
|
|
16
|
-
translate var(--duration-fast) var(--ease-out),
|
|
17
|
-
overlay var(--duration-fast) allow-discrete,
|
|
15
|
+
transition: opacity var(--duration-fast) var(--ease-out),
|
|
16
|
+
translate var(--duration-fast) var(--ease-out),
|
|
17
|
+
overlay var(--duration-fast) allow-discrete,
|
|
18
18
|
display var(--duration-fast) allow-discrete;
|
|
19
19
|
margin: 0;
|
|
20
20
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
color: var(--color-base-content);
|
|
16
16
|
font: inherit;
|
|
17
17
|
font-size: var(--input-text);
|
|
18
|
-
transition: border-color var(--duration-fast) var(--ease-out),
|
|
18
|
+
transition: border-color var(--duration-fast) var(--ease-out),
|
|
19
19
|
background-color var(--duration-fast) var(--ease-out);
|
|
20
20
|
|
|
21
21
|
&::placeholder {
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
overscroll-behavior: contain;
|
|
14
14
|
opacity: 0;
|
|
15
15
|
translate: 0 var(--space-2);
|
|
16
|
-
transition: opacity var(--duration-normal) var(--ease-out),
|
|
17
|
-
translate var(--duration-normal) var(--ease-out),
|
|
18
|
-
scale var(--duration-normal) var(--ease-out),
|
|
19
|
-
overlay var(--duration-normal) allow-discrete,
|
|
16
|
+
transition: opacity var(--duration-normal) var(--ease-out),
|
|
17
|
+
translate var(--duration-normal) var(--ease-out),
|
|
18
|
+
scale var(--duration-normal) var(--ease-out),
|
|
19
|
+
overlay var(--duration-normal) allow-discrete,
|
|
20
20
|
display var(--duration-normal) allow-discrete;
|
|
21
21
|
overflow: auto;
|
|
22
22
|
scale: .96;
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&::backdrop {
|
|
37
|
-
transition: background-color var(--duration-normal) var(--ease-out),
|
|
38
|
-
overlay var(--duration-normal) allow-discrete,
|
|
37
|
+
transition: background-color var(--duration-normal) var(--ease-out),
|
|
38
|
+
overlay var(--duration-normal) allow-discrete,
|
|
39
39
|
display var(--duration-normal) allow-discrete;
|
|
40
40
|
background-color: #0000;
|
|
41
41
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&:indeterminate {
|
|
32
|
-
background: linear-gradient(90deg, transparent 0 30%, var(--progress-color) 30% 70%, transparent 70% 100%) 0 0 / 200% 100%
|
|
32
|
+
background: linear-gradient(90deg, transparent 0 30%, var(--progress-color) 30% 70%, transparent 70% 100%) 0 0 / 200% 100%
|
|
33
33
|
no-repeat var(--color-base-300);
|
|
34
34
|
animation: 1.4s linear infinite poppy-progress-slide;
|
|
35
35
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@layer poppy.components {
|
|
4
4
|
.skeleton {
|
|
5
5
|
border-radius: var(--radius-md);
|
|
6
|
-
background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--color-base-100) 60%, transparent), transparent) -100% 0 /
|
|
6
|
+
background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--color-base-100) 60%, transparent), transparent) -100% 0 /
|
|
7
7
|
50% 100% no-repeat var(--color-base-300);
|
|
8
8
|
animation: 1.5s ease-in-out infinite poppy-skeleton-shimmer;
|
|
9
9
|
display: block;
|
package/dist/components/stat.css
CHANGED
package/dist/components/tabs.css
CHANGED
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
font-size: var(--tabs-font);
|
|
41
41
|
font-weight: var(--weight-medium);
|
|
42
42
|
cursor: pointer;
|
|
43
|
-
transition: color var(--duration-fast) var(--ease-out),
|
|
44
|
-
border-color var(--duration-fast) var(--ease-out),
|
|
43
|
+
transition: color var(--duration-fast) var(--ease-out),
|
|
44
|
+
border-color var(--duration-fast) var(--ease-out),
|
|
45
45
|
background-color var(--duration-fast) var(--ease-out);
|
|
46
46
|
border-block-end: 2px solid #0000;
|
|
47
47
|
order: 1;
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
|
|
47
47
|
.toast[popover] {
|
|
48
48
|
opacity: 0;
|
|
49
|
-
transition: opacity var(--duration-normal) var(--ease-out),
|
|
50
|
-
overlay var(--duration-normal) allow-discrete,
|
|
49
|
+
transition: opacity var(--duration-normal) var(--ease-out),
|
|
50
|
+
overlay var(--duration-normal) allow-discrete,
|
|
51
51
|
display var(--duration-normal) allow-discrete;
|
|
52
52
|
|
|
53
53
|
&:popover-open {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
border-radius: var(--radius-full);
|
|
16
16
|
background: var(--color-base-300);
|
|
17
17
|
cursor: pointer;
|
|
18
|
-
transition: background-color var(--duration-normal) var(--ease-out),
|
|
18
|
+
transition: background-color var(--duration-normal) var(--ease-out),
|
|
19
19
|
border-color var(--duration-normal) var(--ease-out);
|
|
20
20
|
flex: none;
|
|
21
21
|
align-items: center;
|