mnfst 0.5.231 → 0.5.232

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.
@@ -0,0 +1,253 @@
1
+ /* Manifest Rich Text */
2
+
3
+ @layer base, components, utilities;
4
+
5
+ @layer components {
6
+
7
+ :where([data-rich-text]:not([data-edit-text])) {
8
+ position: relative;
9
+ overflow-y: auto;
10
+ max-height: var(--rich-text-max-height, none);
11
+ outline: none;
12
+
13
+ /* Document-wide styles (.all controls, $rich.all) */
14
+ font-family: var(--rich-text-font, inherit);
15
+ font-size: var(--rich-text-size, inherit);
16
+ line-height: var(--rich-text-leading, inherit);
17
+ text-align: var(--rich-text-align, start);
18
+ color: var(--rich-text-color, inherit);
19
+
20
+ /* Placeholder overlays the first line */
21
+ &[data-rich-text-empty]::before {
22
+ content: attr(placeholder);
23
+ position: absolute;
24
+ inset-block-start: var(--rich-text-padding, 0.75rem);
25
+ inset-inline: var(--rich-text-padding, 0.75rem);
26
+ color: var(--color-content-subtle);
27
+ pointer-events: none;
28
+ }
29
+ }
30
+
31
+ /* .all background on an unstyled area */
32
+ :where([data-rich-text].unstyle[style*="--rich-text-background"]) {
33
+ background: var(--rich-text-background);
34
+ }
35
+
36
+ /* Unstyled: placeholder hugs the line */
37
+ :where([data-rich-text].unstyle)[data-rich-text-empty]::before {
38
+ inset-block-start: 0;
39
+ inset-inline: 0;
40
+ }
41
+
42
+ /* Field look; .unstyle drops it */
43
+ :where([data-rich-text]:not(.unstyle, [data-edit-text])) {
44
+ min-height: var(--rich-text-min-height, 8rem);
45
+ padding: var(--rich-text-padding, 0.75rem);
46
+ background: var(--rich-text-background, var(--color-surface-1));
47
+ border: 1px solid var(--color-line);
48
+ border-radius: var(--radius);
49
+
50
+ /* Held while a focus-taking control acts on the area */
51
+ &:focus,
52
+ &[data-rich-text-focused] {
53
+ border-color: var(--color-content-subtle);
54
+ }
55
+ }
56
+
57
+ /* Single-line (.inline) */
58
+ :where([data-rich-text-inline]:not(.unstyle, [data-edit-text])) {
59
+ min-height: var(--rich-text-min-height, auto);
60
+ }
61
+
62
+ /* ---- Selection menu (x-rich-text-menu) ---- */
63
+ :where([data-rich-text-menu]) {
64
+ position: fixed;
65
+ margin: 0;
66
+ inset: auto;
67
+ left: var(--rich-text-selection-center);
68
+ top: var(--rich-text-selection-y);
69
+ transform: translate(-50%, calc(-100% - 0.5rem));
70
+ gap: 0.25rem;
71
+ align-items: center;
72
+ padding: 0.25rem;
73
+ background: var(--color-surface-1);
74
+ border: 1px solid var(--color-line);
75
+ border-radius: var(--radius);
76
+ box-shadow: 0 8px 30px rgb(0 0 0 / 0.2);
77
+ }
78
+
79
+ /* Display only while open */
80
+ :where([data-rich-text-menu]:popover-open) {
81
+ display: flex;
82
+ }
83
+
84
+ /* No Popover API: hidden */
85
+ @supports not selector(:popover-open) {
86
+ :where([data-rich-text-menu]) {
87
+ display: none;
88
+ }
89
+ }
90
+
91
+ /* ---- Controls ---- */
92
+ :where([data-rich-text-control]) {
93
+ &[data-rich-text-active] {
94
+ background: color-mix(in oklch, var(--color-content-stark) 10%, transparent);
95
+ color: var(--color-content-stark);
96
+ }
97
+
98
+ & > svg {
99
+ width: 1rem;
100
+ height: 1rem;
101
+ }
102
+ }
103
+
104
+ /* Icon-only buttons */
105
+ :where(button[data-rich-text-control]:has(> svg:only-child)) {
106
+ padding: 0.35rem;
107
+ line-height: 0;
108
+ }
109
+
110
+ /* Disabled controls still catch the click, so the area keeps focus */
111
+ :where([data-rich-text-control][aria-disabled=true]) {
112
+ pointer-events: auto;
113
+ }
114
+
115
+ /* ---- Editable content ---- */
116
+ :where([data-rich-text]:not([data-edit-text])) {
117
+
118
+ & > * + * {
119
+ margin-block-start: 0.75em;
120
+ }
121
+
122
+ & :where(h1, h2, h3, h4, h5, h6) {
123
+ font-weight: 600;
124
+ line-height: 1.25;
125
+ }
126
+
127
+ & h1 { font-size: 1.6em }
128
+ & h2 { font-size: 1.35em }
129
+ & h3 { font-size: 1.15em }
130
+
131
+ & :where(ul, ol) {
132
+ padding-inline-start: 1.5em;
133
+ }
134
+
135
+ & li {
136
+ list-style: revert;
137
+ }
138
+
139
+ & blockquote {
140
+ padding-inline-start: 0.85em;
141
+ border-inline-start: 2px solid var(--color-line);
142
+ color: var(--color-content-neutral);
143
+ }
144
+
145
+ & code {
146
+ padding: 0.1em 0.3em;
147
+ border-radius: 4px;
148
+ font-size: 0.9em;
149
+ background: color-mix(in oklch, var(--color-content-stark) 8%, transparent);
150
+ }
151
+
152
+ & pre {
153
+ padding: 0.75em;
154
+ border-radius: var(--radius);
155
+ overflow-x: auto;
156
+ background: color-mix(in oklch, var(--color-content-stark) 8%, transparent);
157
+
158
+ & code {
159
+ padding: 0;
160
+ background: none;
161
+ }
162
+ }
163
+
164
+ & a {
165
+ color: var(--color-brand-content);
166
+ text-decoration: underline;
167
+ }
168
+
169
+ & hr {
170
+ margin-block: 1em;
171
+ }
172
+
173
+ & img {
174
+ max-width: 100%;
175
+ }
176
+
177
+ & table {
178
+ width: 100%;
179
+ table-layout: fixed;
180
+
181
+ & :where(td, th) {
182
+ padding: 0.35em 0.5em;
183
+ border: 1px solid var(--color-line);
184
+ vertical-align: top;
185
+ }
186
+
187
+ & th {
188
+ font-weight: 600;
189
+ text-align: start;
190
+ background: var(--color-surface-2);
191
+ }
192
+ }
193
+
194
+ /* Cell block selection */
195
+ & :where(td, th)[data-rich-text-cell] {
196
+ background: color-mix(in oklch, var(--color-brand-content) 18%, transparent);
197
+ }
198
+
199
+ /* Table border resizing */
200
+ &[data-rich-text-border="x"] { cursor: col-resize }
201
+ &[data-rich-text-border="y"] { cursor: row-resize }
202
+ &[data-rich-text-resizing] { user-select: none }
203
+ &[data-rich-text-resizing="x"] { cursor: col-resize }
204
+ &[data-rich-text-resizing="y"] { cursor: row-resize }
205
+
206
+ /* Task lists */
207
+ & :where(ul[data-checklist]) {
208
+ padding-inline-start: 0.25em;
209
+ list-style: none;
210
+
211
+ & li {
212
+ display: flex;
213
+ align-items: baseline;
214
+ gap: 0.5em;
215
+ list-style: none;
216
+ }
217
+ }
218
+
219
+ & :where(dt) {
220
+ font-weight: 600;
221
+ }
222
+
223
+ & :where(dd) {
224
+ margin-inline-start: 1.5em;
225
+ }
226
+
227
+ & :where(kbd) {
228
+ padding: 0.1em 0.35em;
229
+ border: 1px solid var(--color-line);
230
+ border-radius: 4px;
231
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
232
+ font-size: 0.85em;
233
+ }
234
+
235
+ & :where(mark) {
236
+ background: color-mix(in oklch, var(--color-brand-content) 25%, transparent);
237
+ color: inherit;
238
+ }
239
+
240
+ & :where(small) {
241
+ font-size: 0.8em;
242
+ }
243
+
244
+ & :where(figcaption) {
245
+ font-size: 0.8em;
246
+ color: var(--color-content-neutral);
247
+ }
248
+
249
+ & :where(abbr, dfn) {
250
+ text-decoration: underline dotted;
251
+ }
252
+ }
253
+ }