mnfst 0.5.194 → 0.5.196

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.
@@ -1,4 +1,7 @@
1
- /* Manifest Resize Handles */
1
+ /* Manifest Resize Handles
2
+
3
+ Superseded by x-edit.size (manifest.edit.css) — kept for existing projects.
4
+ Self-contained: handle geometry lives here, not in a shared snippet. */
2
5
 
3
6
  @layer base, components, utilities;
4
7
 
@@ -7,7 +10,7 @@
7
10
  :where([x-resize]) {
8
11
  position: relative;
9
12
 
10
- /* Resize handle area (geometry: styles/snippets/manifest.handles.css) */
13
+ /* Resize handle area */
11
14
  .resize-handle {
12
15
  position: absolute;
13
16
  display: block;
@@ -39,7 +42,81 @@
39
42
  }
40
43
  }
41
44
 
42
- /* Corner cursors (geometry is shared; edit handles use nwse/nesw) */
45
+ /* Handle geometry — edges span their axis, corners stay square */
46
+ .resize-handle-top,
47
+ .resize-handle-bottom {
48
+ left: 0;
49
+ width: 100%;
50
+ height: var(--h);
51
+ cursor: ns-resize;
52
+
53
+ &::before {
54
+ width: 100%
55
+ }
56
+ }
57
+
58
+ .resize-handle-left,
59
+ .resize-handle-right,
60
+ .resize-handle-start,
61
+ .resize-handle-end {
62
+ top: 0;
63
+ width: var(--h);
64
+ height: 100%;
65
+ cursor: ew-resize;
66
+
67
+ &::before {
68
+ height: 100%
69
+ }
70
+ }
71
+
72
+ .resize-handle-top {
73
+ top: calc(var(--h) * -0.5)
74
+ }
75
+
76
+ .resize-handle-bottom {
77
+ bottom: calc(var(--h) * -0.5)
78
+ }
79
+
80
+ .resize-handle-left,
81
+ .resize-handle-top-left,
82
+ .resize-handle-bottom-left {
83
+ left: calc(var(--h) * -0.5)
84
+ }
85
+
86
+ .resize-handle-right,
87
+ .resize-handle-top-right,
88
+ .resize-handle-bottom-right {
89
+ right: calc(var(--h) * -0.5)
90
+ }
91
+
92
+ /* Logical edges — inset-inline-* auto-flips for RTL */
93
+ .resize-handle-start,
94
+ .resize-handle-top-start,
95
+ .resize-handle-bottom-start {
96
+ inset-inline-start: calc(var(--h) * -0.5)
97
+ }
98
+
99
+ .resize-handle-end,
100
+ .resize-handle-top-end,
101
+ .resize-handle-bottom-end {
102
+ inset-inline-end: calc(var(--h) * -0.5)
103
+ }
104
+
105
+ .resize-handle-top-left,
106
+ .resize-handle-top-right,
107
+ .resize-handle-top-start,
108
+ .resize-handle-top-end {
109
+ top: calc(var(--h) * -0.5)
110
+ }
111
+
112
+ .resize-handle-bottom-left,
113
+ .resize-handle-bottom-right,
114
+ .resize-handle-bottom-start,
115
+ .resize-handle-bottom-end {
116
+ bottom: calc(var(--h) * -0.5)
117
+ }
118
+
119
+ /* Corner cursors */
43
120
  .resize-handle-top-left,
44
121
  .resize-handle-top-start {
45
122
  cursor: nw-resize;
@@ -114,120 +191,4 @@
114
191
  [dir=rtl] :where([x-resize]) .resize-handle-bottom-end {
115
192
  cursor: sw-resize;
116
193
  }
117
- }
118
- /* Drag-handle geometry — single source for x-resize and x-edit handles.
119
- The build appends this to standalone copies and adds it once to the bundle.
120
- Hosts set --h (handle thickness) and keep their own chrome: hairline colour,
121
- transition, and corner cursors (resize uses nw/ne/sw/se, edit nwse/nesw). */
122
-
123
- @layer base, components, utilities;
124
-
125
- @layer utilities {
126
-
127
- /* Horizontal edges */
128
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-top, .resize-handle-bottom, .edit-handle-top, .edit-handle-bottom) {
129
- left: 0;
130
- width: 100%;
131
- height: var(--h);
132
- cursor: ns-resize;
133
-
134
- &::before {
135
- width: 100%
136
- }
137
- }
138
-
139
- /* Vertical edges */
140
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-left, .resize-handle-right, .resize-handle-start, .resize-handle-end, .edit-handle-left, .edit-handle-right, .edit-handle-start, .edit-handle-end) {
141
- top: 0;
142
- width: var(--h);
143
- height: 100%;
144
- cursor: ew-resize;
145
-
146
- &::before {
147
- height: 100%
148
- }
149
- }
150
-
151
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-top, .edit-handle-top) {
152
- top: calc(var(--h) * -0.5)
153
- }
154
-
155
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-bottom, .edit-handle-bottom) {
156
- bottom: calc(var(--h) * -0.5)
157
- }
158
-
159
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-left, .edit-handle-left) {
160
- left: calc(var(--h) * -0.5)
161
- }
162
-
163
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-right, .edit-handle-right) {
164
- right: calc(var(--h) * -0.5)
165
- }
166
-
167
- /* Logical edges — inset-inline-* auto-flips for RTL */
168
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-start, .edit-handle-start) {
169
- inset-inline-start: calc(var(--h) * -0.5)
170
- }
171
-
172
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-end, .edit-handle-end) {
173
- inset-inline-end: calc(var(--h) * -0.5)
174
- }
175
-
176
- /* Corners — square and inset; cursors stay with each host */
177
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-top-left, .edit-handle-top-left) {
178
- width: var(--h);
179
- height: var(--h);
180
- top: calc(var(--h) * -0.5);
181
- left: calc(var(--h) * -0.5)
182
- }
183
-
184
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-top-right, .edit-handle-top-right) {
185
- width: var(--h);
186
- height: var(--h);
187
- top: calc(var(--h) * -0.5);
188
- right: calc(var(--h) * -0.5)
189
- }
190
-
191
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-bottom-left, .edit-handle-bottom-left) {
192
- width: var(--h);
193
- height: var(--h);
194
- bottom: calc(var(--h) * -0.5);
195
- left: calc(var(--h) * -0.5)
196
- }
197
-
198
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-bottom-right, .edit-handle-bottom-right) {
199
- width: var(--h);
200
- height: var(--h);
201
- bottom: calc(var(--h) * -0.5);
202
- right: calc(var(--h) * -0.5)
203
- }
204
-
205
- /* Logical corners — inset-inline-* auto-flips for RTL */
206
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-top-start, .edit-handle-top-start) {
207
- width: var(--h);
208
- height: var(--h);
209
- top: calc(var(--h) * -0.5);
210
- inset-inline-start: calc(var(--h) * -0.5)
211
- }
212
-
213
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-top-end, .edit-handle-top-end) {
214
- width: var(--h);
215
- height: var(--h);
216
- top: calc(var(--h) * -0.5);
217
- inset-inline-end: calc(var(--h) * -0.5)
218
- }
219
-
220
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-bottom-start, .edit-handle-bottom-start) {
221
- width: var(--h);
222
- height: var(--h);
223
- bottom: calc(var(--h) * -0.5);
224
- inset-inline-start: calc(var(--h) * -0.5)
225
- }
226
-
227
- :where([x-resize], [data-edit-sizable]) :is(.resize-handle-bottom-end, .edit-handle-bottom-end) {
228
- width: var(--h);
229
- height: var(--h);
230
- bottom: calc(var(--h) * -0.5);
231
- inset-inline-end: calc(var(--h) * -0.5)
232
- }
233
- }
194
+ }
@@ -10,13 +10,18 @@
10
10
 
11
11
  @layer base {
12
12
 
13
+ /* Animates `scale`, not `transform`. With fill mode `both` a transform
14
+ animation keeps its final value forever, which silently overrides any
15
+ transform an author put on a popover — so a menu positioned with
16
+ translate(-50%) simply would not move. The standalone property leaves
17
+ transform free. */
13
18
  @keyframes mnfst-popover-in {
14
19
  from {
15
- transform: scale(.9)
20
+ scale: .9
16
21
  }
17
22
 
18
23
  to {
19
- transform: none
24
+ scale: 1
20
25
  }
21
26
  }
22
27
 
@@ -0,0 +1,204 @@
1
+ /* Manifest Text Edit */
2
+
3
+ @layer base, components, utilities;
4
+
5
+ /* Self-contained. The editable area is a field first — it borrows the tokens inputs
6
+ and textareas use, so it sits in a form without looking bolted on. Controls are
7
+ styled where they are, not by where they sit, because they can be anywhere. */
8
+
9
+ @layer components {
10
+
11
+ :where([data-text-edit]) {
12
+ min-height: var(--text-edit-min-height, 8rem);
13
+ max-height: var(--text-edit-max-height, none);
14
+ overflow-y: auto;
15
+ padding: var(--text-edit-padding, 0.75rem);
16
+ background: var(--text-edit-background, var(--color-surface-1));
17
+ border: 1px solid var(--color-line);
18
+ border-radius: var(--radius);
19
+ outline: none;
20
+
21
+ /* Page-level styling — set by .page controls, read back by $text.page.
22
+ Presentation, so it lives here rather than inside the stored markup. */
23
+ font-family: var(--text-edit-font, inherit);
24
+ font-size: var(--text-edit-size, inherit);
25
+ line-height: var(--text-edit-leading, inherit);
26
+ text-align: var(--text-edit-align, start);
27
+ color: var(--text-edit-color, inherit);
28
+
29
+ &:focus {
30
+ border-color: var(--color-content-subtle);
31
+ }
32
+
33
+ /* Flagged from script: :empty never matches the <br> a contenteditable
34
+ keeps, and the tag holding it is not predictable after a wipe. */
35
+ &[data-text-edit-empty]::before {
36
+ content: attr(placeholder);
37
+ color: var(--color-content-subtle);
38
+ pointer-events: none;
39
+ }
40
+ }
41
+
42
+ /* ---- Controls ----
43
+ A control is marked wherever it lives, so a toolbar is optional markup and
44
+ never a requirement. The reset already dims [aria-disabled=true]. */
45
+ :where([data-text-edit-control]) {
46
+ &[data-text-edit-active] {
47
+ background: color-mix(in oklch, var(--color-content-stark) 10%, transparent);
48
+ color: var(--color-content-stark);
49
+ }
50
+
51
+ & > svg {
52
+ width: 1rem;
53
+ height: 1rem;
54
+ }
55
+ }
56
+
57
+ :where(button[data-text-edit-control]) {
58
+ padding: 0.35rem;
59
+ line-height: 0;
60
+ }
61
+
62
+ /* ---- Editable content ----
63
+ The editor authors real block elements, so style them as elements. Deliberately
64
+ lighter than the .prose class, which sets a reading measure this field can't use. */
65
+ :where([data-text-edit]) {
66
+
67
+ & > * + * {
68
+ margin-block-start: 0.75em;
69
+ }
70
+
71
+ & :where(h1, h2, h3, h4, h5, h6) {
72
+ font-weight: 600;
73
+ line-height: 1.25;
74
+ }
75
+
76
+ & h1 { font-size: 1.6em }
77
+ & h2 { font-size: 1.35em }
78
+ & h3 { font-size: 1.15em }
79
+
80
+ & :where(ul, ol) {
81
+ padding-inline-start: 1.5em;
82
+ }
83
+
84
+ & li {
85
+ list-style: revert;
86
+ }
87
+
88
+ & blockquote {
89
+ padding-inline-start: 0.85em;
90
+ border-inline-start: 2px solid var(--color-line);
91
+ color: var(--color-content-neutral);
92
+ }
93
+
94
+ & code {
95
+ padding: 0.1em 0.3em;
96
+ border-radius: 4px;
97
+ font-size: 0.9em;
98
+ background: color-mix(in oklch, var(--color-content-stark) 8%, transparent);
99
+ }
100
+
101
+ & pre {
102
+ padding: 0.75em;
103
+ border-radius: var(--radius);
104
+ overflow-x: auto;
105
+ background: color-mix(in oklch, var(--color-content-stark) 8%, transparent);
106
+
107
+ & code {
108
+ padding: 0;
109
+ background: none;
110
+ }
111
+ }
112
+
113
+ & a {
114
+ color: var(--color-brand-content);
115
+ text-decoration: underline;
116
+ }
117
+
118
+ & hr {
119
+ margin-block: 1em;
120
+ }
121
+
122
+ & img {
123
+ max-width: 100%;
124
+ }
125
+
126
+ & table {
127
+ width: 100%;
128
+ table-layout: fixed;
129
+
130
+ & :where(td, th) {
131
+ padding: 0.35em 0.5em;
132
+ border: 1px solid var(--color-line);
133
+ vertical-align: top;
134
+ }
135
+
136
+ & th {
137
+ font-weight: 600;
138
+ text-align: start;
139
+ background: var(--color-surface-2);
140
+ }
141
+ }
142
+
143
+ /* A block selection across cells. The browser can only highlight text, so an
144
+ empty cell shows nothing — this is what makes a spreadsheet-style
145
+ selection visible. */
146
+ & :where(td, th)[data-text-edit-cell] {
147
+ background: color-mix(in oklch, var(--color-brand-content) 18%, transparent);
148
+ }
149
+
150
+ /* Borders read as grabbable only when the pointer is on one */
151
+ &[data-text-edit-border="x"] { cursor: col-resize }
152
+ &[data-text-edit-border="y"] { cursor: row-resize }
153
+ &[data-text-edit-resizing] { user-select: none }
154
+ &[data-text-edit-resizing="x"] { cursor: col-resize }
155
+ &[data-text-edit-resizing="y"] { cursor: row-resize }
156
+
157
+ /* Task lists — the checkbox replaces the marker */
158
+ & :where(ul[data-checklist]) {
159
+ padding-inline-start: 0.25em;
160
+ list-style: none;
161
+
162
+ & li {
163
+ display: flex;
164
+ align-items: baseline;
165
+ gap: 0.5em;
166
+ list-style: none;
167
+ }
168
+ }
169
+
170
+ & :where(dt) {
171
+ font-weight: 600;
172
+ }
173
+
174
+ & :where(dd) {
175
+ margin-inline-start: 1.5em;
176
+ }
177
+
178
+ & :where(kbd) {
179
+ padding: 0.1em 0.35em;
180
+ border: 1px solid var(--color-line);
181
+ border-radius: 4px;
182
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
183
+ font-size: 0.85em;
184
+ }
185
+
186
+ & :where(mark) {
187
+ background: color-mix(in oklch, var(--color-brand-content) 25%, transparent);
188
+ color: inherit;
189
+ }
190
+
191
+ & :where(small) {
192
+ font-size: 0.8em;
193
+ }
194
+
195
+ & :where(figcaption) {
196
+ font-size: 0.8em;
197
+ color: var(--color-content-neutral);
198
+ }
199
+
200
+ & :where(abbr, dfn) {
201
+ text-decoration: underline dotted;
202
+ }
203
+ }
204
+ }