@cawalch/porchlight 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/README.md +28 -0
- package/dist/porchlight.css +3765 -0
- package/dist/porchlight.min.css +1 -0
- package/package.json +59 -0
- package/porchlight.css +62 -0
- package/src/00-layer-order.css +22 -0
- package/src/01-reset.css +53 -0
- package/src/02-tokens.css +254 -0
- package/src/03-themes.css +79 -0
- package/src/04-base.css +78 -0
- package/src/05-layout.css +209 -0
- package/src/06-components/accordion.css +161 -0
- package/src/06-components/alert.css +102 -0
- package/src/06-components/avatar.css +112 -0
- package/src/06-components/badge.css +73 -0
- package/src/06-components/breadcrumb.css +111 -0
- package/src/06-components/button.css +180 -0
- package/src/06-components/card.css +186 -0
- package/src/06-components/chip.css +146 -0
- package/src/06-components/command-palette.css +201 -0
- package/src/06-components/data-table.css +380 -0
- package/src/06-components/dialog.css +148 -0
- package/src/06-components/drawer.css +137 -0
- package/src/06-components/dropdown.css +180 -0
- package/src/06-components/empty-state.css +85 -0
- package/src/06-components/field.css +125 -0
- package/src/06-components/file-upload.css +104 -0
- package/src/06-components/nav.css +185 -0
- package/src/06-components/pagination.css +106 -0
- package/src/06-components/popover-menu.css +146 -0
- package/src/06-components/progress.css +77 -0
- package/src/06-components/reveal.css +73 -0
- package/src/06-components/scroll-progress.css +73 -0
- package/src/06-components/segmented.css +113 -0
- package/src/06-components/skeleton.css +73 -0
- package/src/06-components/stat.css +107 -0
- package/src/06-components/stepper.css +172 -0
- package/src/06-components/switch.css +138 -0
- package/src/06-components/tabs.css +164 -0
- package/src/06-components/tag-input.css +77 -0
- package/src/06-components/textarea-auto.css +77 -0
- package/src/06-components/timeline.css +129 -0
- package/src/06-components/toast.css +175 -0
- package/src/06-components/toolbar.css +87 -0
- package/src/06-components/tooltip.css +104 -0
- package/src/07-utilities.css +77 -0
- package/src/08-enhancements.css +129 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Porchlight: progressive enhancements
|
|
3
|
+
* ===========================================================================
|
|
4
|
+
* Tier B features, all gated behind @supports. The framework is fully usable
|
|
5
|
+
* without any of these; they layer on where the browser supports them, with
|
|
6
|
+
* zero behavior change where it doesn't.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* 1. interpolate-size: allow-keywords on :root, so height/width can animate
|
|
10
|
+
* to/from auto and content-keyword sizes (Baseline 2026; enables
|
|
11
|
+
* disclosure/collapsible animations without measuring JS).
|
|
12
|
+
* 2. scroll-state container queries: a .c-sticky-shell that gains a shadow
|
|
13
|
+
* when it becomes stuck (the "app-bar shadow on scroll" pattern, no JS).
|
|
14
|
+
* 3. text-box: trim-both cap alphabetic on buttons/badges, removing the
|
|
15
|
+
* cap-height half-leading for optically-centered labels.
|
|
16
|
+
* 4. rule (CSS Gap Decorations): dividers between grid/flex items via
|
|
17
|
+
* [data-dividers] on .l-grid, purely visual (no layout impact).
|
|
18
|
+
* 5. Advanced typed attr(): a .c-swatch that reads its color from a
|
|
19
|
+
* data-color attribute, type-checked as <color>.
|
|
20
|
+
*
|
|
21
|
+
* Each block stands alone and degrades cleanly. Nothing here is in the
|
|
22
|
+
* critical path; everything below is opt-in via @supports.
|
|
23
|
+
*/
|
|
24
|
+
@layer porchlight.enhancements {
|
|
25
|
+
/* 1. Allow animating to/from intrinsic sizes (content, auto). Enables
|
|
26
|
+
native disclosure/collapsible animations and @starting-style on
|
|
27
|
+
auto-sized elements. */
|
|
28
|
+
@supports (interpolate-size: allow-keywords) {
|
|
29
|
+
:root {
|
|
30
|
+
interpolate-size: allow-keywords;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* 2. Scroll-state container queries: the sticky-shell shadow pattern.
|
|
35
|
+
A scroll container becomes a scroll-state query container; when its
|
|
36
|
+
sticky child is "stuck to top", the inner bar gains an elevation shadow.
|
|
37
|
+
Replaces the JS scroll-listener pattern entirely. */
|
|
38
|
+
@supports (container-type: scroll-state) {
|
|
39
|
+
.c-sticky-shell {
|
|
40
|
+
container-type: scroll-state;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.c-sticky-shell__bar {
|
|
44
|
+
position: sticky;
|
|
45
|
+
inset-block-start: 0;
|
|
46
|
+
z-index: var(--pl-z-sticky);
|
|
47
|
+
background: var(--pl-color-surface);
|
|
48
|
+
transition:
|
|
49
|
+
box-shadow var(--pl-duration-2) var(--pl-ease-standard),
|
|
50
|
+
background-color var(--pl-duration-2) var(--pl-ease-standard);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@container scroll-state(stuck: top) {
|
|
54
|
+
.c-sticky-shell__bar {
|
|
55
|
+
box-shadow: var(--pl-shadow-2);
|
|
56
|
+
background: color-mix(
|
|
57
|
+
in oklab,
|
|
58
|
+
var(--pl-color-surface),
|
|
59
|
+
transparent 18%
|
|
60
|
+
);
|
|
61
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
62
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
63
|
+
border-block-end: 1px solid color-mix(
|
|
64
|
+
in oklab,
|
|
65
|
+
var(--pl-color-border),
|
|
66
|
+
transparent 55%
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* 3. text-box: optical alignment. Trims the cap-height half-leading so a
|
|
73
|
+
single-line label sits visually centered without the inline-box overshoot
|
|
74
|
+
that makes controls look 1px off. */
|
|
75
|
+
@supports (text-box: trim-both cap alphabetic) {
|
|
76
|
+
:where(.c-button, .c-badge, .c-dialog__close) {
|
|
77
|
+
text-box: trim-both cap alphabetic;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 4. CSS Gap Decorations: vertical dividers between grid items, purely
|
|
82
|
+
visual (the gap stays, a rule is drawn in it). Opt in via
|
|
83
|
+
[data-dividers="true"] on .l-grid. The `rule` properties are behind
|
|
84
|
+
@supports so unsupported browsers just show the normal gap. */
|
|
85
|
+
@supports (rule: 1px solid CanvasText) {
|
|
86
|
+
:where(.l-grid[data-dividers="true"]) {
|
|
87
|
+
rule: 1px solid var(--pl-color-border);
|
|
88
|
+
rule-visibility-items: between;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* 5. Advanced typed attr(): a swatch that reads its color directly from a
|
|
93
|
+
data-color attribute, type-checked as <color> (with a token fallback).
|
|
94
|
+
Removes the need for inline style="" for static color chips. */
|
|
95
|
+
@supports (background: attr(data-color type(<color>))) {
|
|
96
|
+
.c-swatch {
|
|
97
|
+
background: attr(data-color type(<color>), var(--pl-color-border));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* 6. View Transitions: opt-in cross-document page animations (Baseline 2026).
|
|
102
|
+
Apps set <meta name="view-transition" content="same-origin"> or use the
|
|
103
|
+
Navigation API. This block styles the default entry/exit fade with the
|
|
104
|
+
framework's asymmetric enter/exit duration tokens so navigations feel
|
|
105
|
+
consistent with the rest of the motion language. */
|
|
106
|
+
@supports (view-transition-name: root) {
|
|
107
|
+
@view-transition {
|
|
108
|
+
navigation: auto;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
::view-transition-old(root) {
|
|
112
|
+
animation:
|
|
113
|
+
var(--pl-duration-exit) var(--pl-ease-accelerate) both pl-fade-out;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
::view-transition-new(root) {
|
|
117
|
+
animation:
|
|
118
|
+
var(--pl-duration-enter) var(--pl-ease-decelerate) both pl-fade-in;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@keyframes pl-fade-out {
|
|
122
|
+
to { opacity: 0; }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@keyframes pl-fade-in {
|
|
126
|
+
from { opacity: 0; }
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|