palace-ui 0.14.0 → 0.15.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/SPEC.md +22 -4
- package/catalog.html +8 -3
- package/package.json +1 -1
- package/palace.css +6 -4
package/SPEC.md
CHANGED
|
@@ -101,6 +101,24 @@ Sizes for both: `xs` (4px), `sm` (8px), `md` (16px), `lg` (24px), `xl` (32px), `
|
|
|
101
101
|
|
|
102
102
|
**Exceptions:** dividers (`.divider`, `.divider-danger`, `.gradient-stripe`) use top and bottom margin because they are separators by nature. `margin: auto` centres containers and dialogs. The `.stat-label` 2px optical nudge and the rules between the navbar menu's groups are part of those components.
|
|
103
103
|
|
|
104
|
+
### Shadows
|
|
105
|
+
|
|
106
|
+
Offsets only; combine with a colour: `box-shadow: var(--p-shadow-md) var(--p-accent-2)`. Pick a size by role, never write a raw offset. Inset indicator lines (`inset 3px 0 0`) are not offset shadows and stay as they are.
|
|
107
|
+
|
|
108
|
+
| Token | Usage |
|
|
109
|
+
|---|---|
|
|
110
|
+
| `--p-shadow-xs` | Keys (`kbd`) |
|
|
111
|
+
| `--p-shadow-sm` | Small chips |
|
|
112
|
+
| `--p-shadow-md` | Controls: hover and focus |
|
|
113
|
+
| `--p-shadow-lg` | Boxes and cards: status boxes, cards, dialogs, the navbar menu panel |
|
|
114
|
+
|
|
115
|
+
Boxes, by component:
|
|
116
|
+
|
|
117
|
+
- **`lg`:** `.card-static` (`--p-text`, at rest and on hover; it never lifts), `.status` (`--p-text`), `dialog` and `.navbar-menu-panel` (`--p-accent-2`; the panel floats above the page like a dialog), and `.card` on hover (the lift casts its accent; at rest a `.card` is flat, so a list of cards shows the shadow where the pointer is).
|
|
118
|
+
- **Deliberately none:** tables (rules between rows, no outer box), `pre` and `.code-reveal` (they scroll sideways, which would clip a shadow), `.tag-sticker` and other tags (small chips, flat), and the disabled state of any control.
|
|
119
|
+
|
|
120
|
+
A shadow reaches 4px right and below its box. Leave that room inside a container that clips (`overflow: hidden`, `auto` or `scroll`); palace's own layouts clip nothing a box sits in.
|
|
121
|
+
|
|
104
122
|
### Layout
|
|
105
123
|
|
|
106
124
|
| Token | Value |
|
|
@@ -325,7 +343,7 @@ For explicit accent control (e.g. server-rendered cards), use the `--accent` cus
|
|
|
325
343
|
|
|
326
344
|
### Static Card
|
|
327
345
|
|
|
328
|
-
For cards used as form containers or static content that should not lift on hover:
|
|
346
|
+
For cards used as form containers or static content that should not lift on hover. It keeps its `--p-shadow-lg` shadow in `--p-text`, at rest and on hover:
|
|
329
347
|
|
|
330
348
|
```html
|
|
331
349
|
<div class="card-static space-md">
|
|
@@ -741,7 +759,7 @@ A native `<dialog>` styled as a card: border, purple offset shadow, overlay back
|
|
|
741
759
|
|
|
742
760
|
### Kbd
|
|
743
761
|
|
|
744
|
-
Inline keyboard key: bordered, uppercase mono, with a
|
|
762
|
+
Inline keyboard key: bordered, uppercase mono, with a pink `--p-shadow-xs` shadow.
|
|
745
763
|
|
|
746
764
|
```html
|
|
747
765
|
<kbd>Ctrl</kbd> + <kbd>Z</kbd>
|
|
@@ -853,7 +871,7 @@ Full container, no navbar. Hero section, then card list, then footer.
|
|
|
853
871
|
## Interaction Rules
|
|
854
872
|
|
|
855
873
|
1. **Hover = lift + shadow.** Elements move `translate(-1px, -1px)` or `translate(-2px, -2px)` and cast a hard shadow in the opposite direction. Shadow color matches the element's accent.
|
|
856
|
-
2. **Focus = border-color + shadow.** Input focus changes border to accent-2 (purple) and adds
|
|
874
|
+
2. **Focus = border-color + shadow.** Input focus changes border to accent-2 (purple) and adds the `--p-shadow-md` shadow. Number inputs focus to accent-1 (pink).
|
|
857
875
|
3. **Disabled = flat gray.** `#ddd` background, `#999` text, `#ccc` border. No transform, no shadow, `cursor: not-allowed`.
|
|
858
876
|
4. **Transitions are 0.1s.** Never slower. The UI should feel mechanical and responsive.
|
|
859
877
|
5. **Links underline with border-bottom**, not `text-decoration`. Hover swaps from accent-2 (purple) to accent-1 (pink).
|
|
@@ -876,7 +894,7 @@ Full container, no navbar. Hero section, then card list, then footer.
|
|
|
876
894
|
- Use the 3-color card rotation for any list of cards
|
|
877
895
|
- Keep `border-radius: 0` everywhere
|
|
878
896
|
- Use `2px solid` borders on cards, buttons, inputs
|
|
879
|
-
- Use hard shadows (
|
|
897
|
+
- Use hard shadows (a `--p-shadow-*` size and a colour) — never blurred shadows
|
|
880
898
|
- Use `font-weight: 700` for headings and buttons
|
|
881
899
|
- Use `letter-spacing` on all uppercase text (0.5px to 2px)
|
|
882
900
|
- Keep containers at 640px max width
|
package/catalog.html
CHANGED
|
@@ -340,11 +340,16 @@
|
|
|
340
340
|
<div class="space-xs">
|
|
341
341
|
<p class="eyebrow" style="color: var(--p-accent-1);">Tokens</p>
|
|
342
342
|
<h2 id="shadows">Shadows</h2>
|
|
343
|
-
<p class="subtitle">Hard shadows only. Zero blur, always.</p>
|
|
343
|
+
<p class="subtitle">Hard shadows only. Zero blur, always. Keys take xs, small chips sm, controls md, boxes and cards lg.</p>
|
|
344
344
|
</div>
|
|
345
345
|
|
|
346
346
|
<div class="space-sm">
|
|
347
347
|
<div data-source class="gap-lg" style="display: flex; flex-wrap: wrap;">
|
|
348
|
+
<div class="gap-sm" style="display: grid; justify-items: center;">
|
|
349
|
+
<div style="width: 100px; height: 100px; background: var(--p-surface); border: 2px solid var(--p-text); box-shadow: var(--p-shadow-xs) var(--p-accent-3);"></div>
|
|
350
|
+
<div class="stat-label">--p-shadow-xs</div>
|
|
351
|
+
<code style="font-size: 11px;">1px 1px 0</code>
|
|
352
|
+
</div>
|
|
348
353
|
<div class="gap-sm" style="display: grid; justify-items: center;">
|
|
349
354
|
<div style="width: 100px; height: 100px; background: var(--p-surface); border: 2px solid var(--p-text); box-shadow: var(--p-shadow-sm) var(--p-accent-1);"></div>
|
|
350
355
|
<div class="stat-label">--p-shadow-sm</div>
|
|
@@ -465,11 +470,11 @@
|
|
|
465
470
|
</div>
|
|
466
471
|
|
|
467
472
|
<div class="space-sm">
|
|
468
|
-
<h3>Static Card (no
|
|
473
|
+
<h3>Static Card (no lift, keeps its large shadow)</h3>
|
|
469
474
|
<div data-source>
|
|
470
475
|
<div class="card-static">
|
|
471
476
|
<span class="h2">Form Container</span>
|
|
472
|
-
<p style="color: var(--p-text-secondary); font-size: 14px;">Use <code>.card-static</code> for cards that hold forms or content that shouldn't lift on hover.</p>
|
|
477
|
+
<p style="color: var(--p-text-secondary); font-size: 14px;">Use <code>.card-static</code> for cards that hold forms or content that shouldn't lift on hover; it keeps the large shadow.</p>
|
|
473
478
|
</div>
|
|
474
479
|
</div>
|
|
475
480
|
</div>
|
package/package.json
CHANGED
package/palace.css
CHANGED
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
--p-radius: 0;
|
|
86
86
|
|
|
87
87
|
/* ── Shadows (offsets only — combine with color) ── */
|
|
88
|
+
--p-shadow-xs: 1px 1px 0;
|
|
88
89
|
--p-shadow-sm: 2px 2px 0;
|
|
89
90
|
--p-shadow-md: 3px 3px 0;
|
|
90
91
|
--p-shadow-lg: 4px 4px 0;
|
|
@@ -526,16 +527,17 @@ button:disabled, .btn:disabled, .cta:disabled {
|
|
|
526
527
|
line-height: 1.6;
|
|
527
528
|
}
|
|
528
529
|
|
|
529
|
-
/* Static card — no hover lift
|
|
530
|
+
/* Static card — no hover lift (for form containers); its large shadow stays, at rest and on hover */
|
|
530
531
|
.card-static {
|
|
531
532
|
background: var(--p-surface);
|
|
532
533
|
border: var(--p-border-width) solid var(--p-text);
|
|
534
|
+
box-shadow: var(--p-shadow-lg) var(--p-text);
|
|
533
535
|
padding: var(--p-space-lg);
|
|
534
536
|
}
|
|
535
537
|
|
|
536
538
|
.card-static:hover {
|
|
537
539
|
transform: none;
|
|
538
|
-
box-shadow:
|
|
540
|
+
box-shadow: var(--p-shadow-lg) var(--p-text);
|
|
539
541
|
}
|
|
540
542
|
|
|
541
543
|
|
|
@@ -911,7 +913,7 @@ summary:focus-visible {
|
|
|
911
913
|
background: var(--p-surface);
|
|
912
914
|
color: var(--p-text);
|
|
913
915
|
border: var(--p-border-width) solid var(--p-text);
|
|
914
|
-
box-shadow: var(--p-shadow-
|
|
916
|
+
box-shadow: var(--p-shadow-lg) var(--p-accent-2);
|
|
915
917
|
}
|
|
916
918
|
/* The margin resets sit in :where() so a space-* utility on the panel beats them. */
|
|
917
919
|
:where(.navbar-menu-panel ul) { margin: 0; }
|
|
@@ -1365,7 +1367,7 @@ kbd {
|
|
|
1365
1367
|
display: inline-block;
|
|
1366
1368
|
padding: 1px 5px;
|
|
1367
1369
|
border: var(--p-border-thin) solid var(--p-text);
|
|
1368
|
-
box-shadow:
|
|
1370
|
+
box-shadow: var(--p-shadow-xs) var(--p-accent-1);
|
|
1369
1371
|
background: var(--p-surface-inset);
|
|
1370
1372
|
/* Its own text colour: on its light background, a key must not take a button's white. */
|
|
1371
1373
|
color: var(--p-text);
|