@foblex/m-render 4.0.0 → 4.0.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.
@@ -1,12 +1,25 @@
1
1
  .f-badge {
2
- display: inline-block;
3
- border: 1px solid var(--divider-color);
4
- border-radius: 999px;
5
- padding: 0 10px;
6
- line-height: 22px;
7
- font-size: 11px;
8
- font-weight: 600;
9
- letter-spacing: 0.02em;
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ box-sizing: border-box;
6
+ height: var(--f-badge-height);
7
+ padding: 0 var(--f-badge-padding-x);
8
+ border-radius: var(--f-badge-border-radius);
9
+ font-size: var(--f-badge-font-size);
10
+ font-weight: var(--f-badge-font-weight);
11
+ line-height: 1;
12
+ letter-spacing: var(--f-badge-letter-spacing);
13
+ white-space: nowrap;
14
+ vertical-align: middle;
15
+ border: none;
16
+ text-transform: none;
17
+
18
+ &.sm {
19
+ height: var(--f-badge-compact-height);
20
+ padding: 0 var(--f-badge-compact-padding-x);
21
+ font-size: var(--f-badge-compact-font-size);
22
+ }
10
23
 
11
24
  &.tip {
12
25
  color: var(--f-badge-tip-color);
@@ -36,23 +49,24 @@
36
49
 
37
50
  f-navigation-panel {
38
51
  .f-badge {
39
- padding: 0 6px;
40
- line-height: 18px;
52
+ height: var(--f-badge-compact-height);
53
+ padding: 0 var(--f-badge-compact-padding-x);
54
+ font-size: var(--f-badge-compact-font-size);
41
55
  }
42
56
  }
43
57
 
44
58
  .m-render h1 > .f-badge {
45
- margin-top: 4px;
59
+ margin-top: 6px;
46
60
  vertical-align: top;
47
61
  }
48
62
 
49
63
  .m-render h2 > .f-badge {
50
- margin-top: 3px;
51
- padding: 0 8px;
64
+ margin-top: 4px;
52
65
  vertical-align: top;
53
66
  }
54
67
 
55
68
  .m-render h3 > .f-badge {
69
+ margin-top: 1px;
56
70
  vertical-align: middle;
57
71
  }
58
72
 
@@ -60,5 +74,4 @@ f-navigation-panel {
60
74
  .m-render h5 > .f-badge,
61
75
  .m-render h6 > .f-badge {
62
76
  vertical-align: middle;
63
- line-height: 18px;
64
77
  }
@@ -12,7 +12,6 @@
12
12
  border: 1px solid var(--code-view-border-color);
13
13
  border-radius: var(--code-group-border-radius);
14
14
  background-color: var(--code-group-tabs-background);
15
- box-shadow: var(--shadow-1);
16
15
  overflow: hidden;
17
16
  height: 100%;
18
17
  width: 100%;
@@ -1,18 +1,18 @@
1
1
  .m-render {
2
- --token-tag: var(--primary-text);
3
- --token-attr-name: var(--important-2);
4
- --token-attr-value: var(--success-2);
5
- --token-string: var(--success-2);
6
- --token-punctuation: var(--secondary-text);
7
- --token-keyword: var(--important-2);
8
- --token-function: var(--primary-text);
9
- --token-number: var(--warning-2);
10
- --token-operator: var(--secondary-text);
11
- --token-interpolation: var(--important-1);
12
- --token-expression: var(--primary-text);
13
- --token-comment: var(--tertiary-text);
14
- --token-selector: var(--primary-text);
15
- --token-variable: var(--important-1);
2
+ --token-tag: var(--code-syntax-4);
3
+ --token-attr-name: var(--code-syntax-4);
4
+ --token-attr-value: var(--code-syntax-3);
5
+ --token-string: var(--code-syntax-3);
6
+ --token-punctuation: var(--code-syntax-muted);
7
+ --token-keyword: var(--code-syntax-2);
8
+ --token-function: var(--code-syntax-1);
9
+ --token-number: var(--code-syntax-5);
10
+ --token-operator: var(--code-syntax-muted);
11
+ --token-interpolation: var(--code-syntax-5);
12
+ --token-expression: var(--code-view-text-color);
13
+ --token-comment: var(--code-syntax-comment);
14
+ --token-selector: var(--code-syntax-4);
15
+ --token-variable: var(--code-syntax-4);
16
16
  }
17
17
 
18
18
  .m-render {
@@ -72,7 +72,6 @@
72
72
  }
73
73
  }
74
74
 
75
-
76
75
  .m-render {
77
76
  .language-scss .token.selector,
78
77
  .language-css .token.selector {
@@ -92,7 +91,7 @@
92
91
  }
93
92
 
94
93
  .language-scss .token.variable {
95
- color: var(--token-variable, var(--important-1));
94
+ color: var(--token-variable, var(--code-syntax-4));
96
95
  }
97
96
 
98
97
  .language-scss .token.keyword {
@@ -18,11 +18,16 @@
18
18
 
19
19
  code {
20
20
  display: block;
21
- padding: 18px 22px;
21
+ padding:
22
+ var(--code-view-padding-top)
23
+ var(--code-view-padding-right)
24
+ var(--code-view-padding-bottom)
25
+ var(--code-view-padding-left);
22
26
  width: fit-content;
23
27
  min-width: 100%;
24
28
  line-height: var(--code-view-line-height);
25
29
  font-size: var(--code-view-font-size);
30
+ font-weight: 400;
26
31
  color: var(--code-view-text-color);
27
32
  }
28
33
  }
@@ -31,33 +36,81 @@
31
36
  position: relative;
32
37
  background-color: var(--code-view-background);
33
38
  border: 1px solid var(--code-view-border-color);
34
- box-shadow: var(--shadow-1);
35
39
  border-radius: var(--code-view-border-radius);
36
- overflow-x: auto;
40
+ overflow: hidden;
37
41
  width: 100%;
38
42
 
39
- .f-copy-button {
43
+ .f-code-controls {
40
44
  position: absolute;
41
- top: 10px;
42
- right: 10px;
43
- border: 1px solid var(--code-view-copy-button-border-color);
44
- border-radius: 10px;
45
- min-width: 58px;
46
- height: 28px;
47
- padding: 0 12px;
45
+ top: 0;
46
+ right: 0;
47
+ display: flex;
48
+ flex-direction: column;
49
+ align-items: flex-end;
50
+ gap: 4px;
48
51
  z-index: 3;
49
- background-color: var(--code-view-copy-button-background);
52
+ padding: 10px 10px 0 0;
53
+ border-radius: inherit;
54
+ pointer-events: none;
55
+ background-color: transparent;
56
+ transition: background-color 0.2s ease;
57
+ }
58
+
59
+ .f-copy-button {
60
+ border: none;
61
+ border-radius: 8px;
62
+ position: relative;
63
+ min-width: 32px;
64
+ height: 32px;
65
+ width: 32px;
66
+ padding: 0;
67
+ background-color: transparent;
50
68
  opacity: 1;
51
69
  cursor: pointer;
52
- color: var(--primary-text);
53
- font-size: 12px;
54
- font-weight: 600;
55
- line-height: 1;
56
- transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
70
+ color: var(--secondary-text);
71
+ line-height: 0;
72
+ pointer-events: auto;
73
+ transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
57
74
 
58
75
  &:hover {
59
76
  background-color: var(--code-view-copy-button-hover-background);
60
- border-color: var(--dark-divider-color);
77
+ color: var(--primary-text);
78
+ }
79
+ }
80
+
81
+ .f-copy-icon,
82
+ .f-copy-success-icon {
83
+ position: absolute;
84
+ inset: 0;
85
+ margin: auto;
86
+ width: 16px;
87
+ height: 16px;
88
+ background-color: currentColor;
89
+ mask-position: center;
90
+ mask-repeat: no-repeat;
91
+ mask-size: 16px 16px;
92
+ transition: transform 0.22s ease, opacity 0.18s ease;
93
+ transform: scale(1);
94
+ opacity: 1;
95
+ }
96
+
97
+ .f-copy-icon {
98
+ mask-image: var(--copy-icon);
99
+
100
+ &.hidden {
101
+ transform: scale(0.6);
102
+ opacity: 0;
103
+ }
104
+ }
105
+
106
+ .f-copy-success-icon {
107
+ mask-image: var(--check-icon);
108
+ transform: scale(0.6);
109
+ opacity: 0;
110
+
111
+ &.visible {
112
+ transform: scale(1);
113
+ opacity: 1;
61
114
  }
62
115
  }
63
116
 
@@ -105,10 +158,19 @@
105
158
  }
106
159
 
107
160
  .f-code-language {
161
+ pointer-events: none;
108
162
  position: absolute;
109
163
  top: 18px;
110
- right: 80px;
164
+ right: 12px;
165
+ z-index: 2;
166
+ display: block;
167
+ max-width: calc(100% - 24px);
168
+ overflow: hidden;
169
+ text-overflow: ellipsis;
170
+ white-space: nowrap;
171
+ text-align: right;
111
172
  font-size: 10px;
173
+ line-height: 1;
112
174
  font-weight: 400;
113
175
  color: var(--code-view-lang-color);
114
176
  transition: opacity 0.4s;
@@ -116,15 +178,37 @@
116
178
  opacity: 0.72;
117
179
  }
118
180
 
119
- &:hover {
120
- .f-copy-button:active {
121
- opacity: 0.7;
181
+ @media (hover: hover) and (pointer: fine) {
182
+ .f-copy-button {
183
+ opacity: 0;
184
+ pointer-events: none;
185
+ transform: scale(0.92);
122
186
  }
123
187
 
124
- .f-code-language {
125
- opacity: 0.85;
188
+ &:hover,
189
+ &:focus-within {
190
+ .f-code-controls {
191
+ background-color: var(--code-view-background);
192
+ }
193
+
194
+ .f-copy-button {
195
+ opacity: 1;
196
+ pointer-events: auto;
197
+ transform: scale(1);
198
+
199
+ &:active {
200
+ opacity: 0.7;
201
+ }
202
+ }
203
+
204
+ .f-code-language {
205
+ opacity: 0;
206
+ }
126
207
  }
208
+ }
127
209
 
210
+ &:hover,
211
+ &:focus-within {
128
212
  .f-fullscreen-button {
129
213
  opacity: 1;
130
214
 
@@ -135,13 +219,37 @@
135
219
  }
136
220
  }
137
221
 
222
+ .f-code-view {
223
+ .f-code-scroll {
224
+ width: 100%;
225
+ height: 100%;
226
+ overflow: auto;
227
+ border-radius: inherit;
228
+ }
229
+ }
230
+
138
231
  .f-example-view {
139
232
  width: 100%;
140
233
  height: 300px;
141
234
  overflow: hidden;
235
+ box-shadow: var(--shadow-1);
142
236
 
143
237
  &.f-example-view-fullscreen {
238
+ background-color: var(--background-color);
144
239
  border-radius: 0;
240
+ border-color: transparent;
241
+ box-shadow: none;
242
+ }
243
+
244
+ &:fullscreen {
245
+ background-color: var(--background-color);
246
+ border-radius: 0;
247
+ border-color: transparent;
248
+ box-shadow: none;
249
+ }
250
+
251
+ &::backdrop {
252
+ background-color: var(--background-color);
145
253
  }
146
254
 
147
255
  .f-example-iframe {
@@ -150,6 +258,42 @@
150
258
  border: none;
151
259
  }
152
260
 
261
+ .f-example-loading-overlay {
262
+ position: absolute;
263
+ inset: 0;
264
+ z-index: 2;
265
+ display: flex;
266
+ align-items: center;
267
+ justify-content: center;
268
+ background-color: color-mix(in srgb, var(--code-view-background) 84%, transparent);
269
+ backdrop-filter: blur(6px);
270
+ }
271
+
272
+ .f-loading-dots {
273
+ display: flex;
274
+ align-items: center;
275
+ justify-content: center;
276
+ gap: 4px;
277
+ min-height: 24px;
278
+ color: var(--secondary-text);
279
+ }
280
+
281
+ .f-loading-dot {
282
+ width: 8px;
283
+ height: 8px;
284
+ border-radius: 999px;
285
+ background-color: currentColor;
286
+ animation: f-loading-dot-pulse 1s infinite both;
287
+
288
+ &:nth-child(2) {
289
+ animation-delay: 0.2s;
290
+ }
291
+
292
+ &:nth-child(3) {
293
+ animation-delay: 0.4s;
294
+ }
295
+ }
296
+
153
297
  &.f-example-view-fullscreen .f-fullscreen-button {
154
298
  opacity: 1;
155
299
  }
@@ -161,3 +305,17 @@
161
305
  }
162
306
  }
163
307
  }
308
+
309
+ @keyframes f-loading-dot-pulse {
310
+ 0% {
311
+ opacity: 0.15;
312
+ }
313
+
314
+ 20% {
315
+ opacity: 0.4;
316
+ }
317
+
318
+ 100% {
319
+ opacity: 0.15;
320
+ }
321
+ }
@@ -1,93 +1,76 @@
1
- .m-render {
1
+ .m-render .doc-content {
2
+ overflow-wrap: anywhere;
2
3
 
3
4
  h1, h2, h3, h4, h5, h6 {
4
- margin: 0;
5
5
  position: relative;
6
6
  font-weight: 600;
7
7
  outline: none;
8
+ color: var(--primary-text);
8
9
  }
9
10
 
10
11
  h1 {
11
- letter-spacing: -0.02em;
12
- line-height: 1.15;
13
- font-size: 30px;
12
+ margin-bottom: 0.5rem;
13
+ font-size: 1.75em;
14
+ letter-spacing: -0.04rem;
15
+ line-height: 1.222;
14
16
  }
15
17
 
16
18
  h2 {
17
- margin: 56px 0 18px;
18
- border-top: 1px solid var(--divider-color);
19
- padding-top: 28px;
20
- letter-spacing: -0.02em;
21
- line-height: 1.2;
22
- font-size: 26px;
19
+ border-top: 1px solid var(--doc-divider-color);
20
+ padding-top: 2rem;
21
+ margin-bottom: 1rem;
22
+ font-size: 1.5em;
23
+ line-height: 1.222;
23
24
  }
24
25
 
25
26
  h3 {
26
- margin: 36px 0 0;
27
- letter-spacing: -0.01em;
28
- line-height: 1.25;
29
- font-size: 21px;
27
+ margin-top: 1.125rem;
28
+ margin-bottom: 0.625rem;
29
+ font-size: 1.25em;
30
+ line-height: 1.3;
30
31
  }
31
32
 
32
- h4 {
33
- margin: 24px 0 0;
34
- letter-spacing: -0.01em;
35
- line-height: 1.35;
36
- font-size: 18px;
33
+ h4, h5, h6 {
34
+ font-size: 1em;
35
+ line-height: 1.5;
37
36
  }
38
37
 
39
- @media (min-width: 768px) {
40
- h1 {
41
- letter-spacing: -0.02em;
42
- line-height: 1.1;
43
- font-size: 36px;
44
- }
38
+ h4, h5 {
39
+ margin-top: 1rem;
40
+ margin-bottom: 0.5rem;
45
41
  }
46
42
 
47
- p, summary {
48
- &:not(:first-child) {
49
- margin: 16px 0;
50
- }
43
+ h6 {
44
+ margin-top: 0.75rem;
45
+ margin-bottom: 0.5rem;
51
46
  }
52
47
 
53
- p {
54
- line-height: 1.8;
48
+ p, summary {
49
+ margin: 1em 0;
50
+ line-height: 1.5;
55
51
  }
56
52
 
57
- blockquote {
58
- margin: 24px 0;
59
- border: 1px solid var(--divider-color);
60
- border-radius: calc(var(--border-radius) - 2px);
61
- padding: 16px 18px;
62
- background-color: var(--surface-glass);
63
- color: var(--secondary-text);
53
+ strong {
54
+ font-weight: 600;
64
55
  }
65
56
 
66
- blockquote > p {
67
- margin: 0;
68
- font-size: 16px;
57
+ em {
58
+ font-style: italic;
69
59
  }
70
60
 
71
- a {
72
- font-weight: 500;
73
- color: var(--primary-text);
74
- text-decoration: underline;
75
- text-decoration-color: var(--alpha-20);
76
- text-underline-offset: 3px;
61
+ ul, ol {
62
+ margin: 0.5em 0 1em;
63
+ padding-left: 1.625em;
77
64
 
78
- &:hover {
79
- color: var(--primary-text);
80
- text-decoration-color: currentColor;
65
+ > li > :first-child {
66
+ margin-top: 0;
67
+ margin-bottom: 0;
81
68
  }
82
- }
83
69
 
84
- strong {
85
- font-weight: 600;
86
- }
87
-
88
- ul, ol {
89
- padding-left: 1.25rem;
90
- margin: 16px 0;
70
+ > li ul,
71
+ > li ol {
72
+ margin-top: 0.25em !important;
73
+ }
91
74
  }
92
75
 
93
76
  ul {
@@ -98,31 +81,69 @@
98
81
  list-style: decimal;
99
82
  }
100
83
 
101
- li + li {
102
- margin-top: 8px;
84
+ ul > li,
85
+ ol > li {
86
+ padding-left: 0.375em;
87
+ margin: 0.5em 0;
88
+
89
+ &::marker {
90
+ color: var(--secondary-text);
91
+ font-size: 1em;
92
+ font-weight: 500;
93
+ }
103
94
  }
104
95
 
105
- li > ol, li > ul {
106
- margin: 8px 0 0;
96
+ li {
97
+ min-height: 1.5em;
98
+ margin: 0.5em 0;
99
+ }
100
+
101
+ blockquote {
102
+ position: relative;
103
+ margin: 1.5em 0;
104
+ padding: 0.25em 0 0.25rem 1.5rem;
105
+ color: var(--secondary-text);
106
+ font-weight: 400;
107
+
108
+ &::before {
109
+ position: absolute;
110
+ top: 0;
111
+ bottom: 0;
112
+ left: 0;
113
+ display: block;
114
+ width: 0.25rem;
115
+ border-radius: 2px;
116
+ background: var(--doc-blockquote-bar-color);
117
+ content: "";
118
+ }
119
+
120
+ p {
121
+ margin: 0.5em 0 0;
122
+
123
+ &:first-child {
124
+ margin-top: 0;
125
+ }
126
+ }
107
127
  }
108
128
 
109
129
  hr {
110
- margin: 24px 0;
130
+ margin: 2em 0;
111
131
  border: none;
112
- border-top: 1px solid var(--divider-color);
132
+ border-top: 1px solid var(--doc-divider-color);
113
133
  }
114
134
 
115
135
  :not(pre) > code {
116
- font-size: var(--not-pre-code-font-size);
117
- color: var(--not-pre-code-color);
118
- border: 1px solid var(--divider-color);
119
- border-radius: 8px;
120
- padding: 3px 7px;
136
+ padding: 1px 0.3rem;
137
+ border-radius: 0.25rem;
121
138
  background-color: var(--not-pre-code-background);
122
-
139
+ box-shadow: inset 0 0 0 1px var(--not-pre-code-border-color);
140
+ color: inherit;
141
+ font-family: var(--font-family-mono);
142
+ font-size: var(--not-pre-code-font-size);
143
+ font-weight: 500;
144
+ line-height: inherit;
145
+ white-space: pre-wrap;
123
146
  word-wrap: break-word;
124
147
  word-break: break-word;
125
- white-space: pre-wrap;
126
148
  }
127
149
  }
128
-
@@ -1,5 +1,6 @@
1
1
  :root {
2
2
  --copy-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");
3
+ --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
3
4
  --fullscreen-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E");
4
5
  --fullscreen-exit-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M8 3v3a2 2 0 0 1-2 2H3M21 8h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3M21 16h-3a2 2 0 0 0-2 2v3'/%3E%3C/svg%3E");
5
6
  }
@@ -0,0 +1,50 @@
1
+ .m-render .doc-content a,
2
+ .f-text-link {
3
+ border-radius: var(--f-link-radius);
4
+ color: currentcolor;
5
+ cursor: pointer;
6
+ font-weight: var(--f-link-font-weight);
7
+ overflow-wrap: anywhere;
8
+ transition:
9
+ color 0.15s ease,
10
+ opacity 0.15s ease,
11
+ box-shadow 0.15s ease,
12
+ text-decoration-color 0.15s ease;
13
+
14
+ &:focus-visible {
15
+ outline: 2px solid var(--f-link-focus-color);
16
+ outline-offset: 1px;
17
+ }
18
+ }
19
+
20
+ .m-render .doc-content a {
21
+ text-decoration: underline;
22
+ text-decoration-color: color-mix(in srgb, currentcolor 70%, transparent);
23
+ text-underline-offset: var(--f-link-underline-offset);
24
+
25
+ &:hover {
26
+ color: color-mix(in srgb, currentcolor 80%, transparent);
27
+ }
28
+ }
29
+
30
+ .f-text-link {
31
+ display: inline-flex;
32
+ align-items: center;
33
+ gap: 4px;
34
+ }
35
+
36
+ .f-text-link-primary {
37
+ color: var(--f-link-primary-color);
38
+ font-weight: 500;
39
+ text-decoration: none;
40
+
41
+ &:hover {
42
+ color: var(--f-link-primary-hover-color);
43
+ }
44
+
45
+ &[data-underline] {
46
+ text-decoration: underline;
47
+ text-decoration-color: color-mix(in srgb, currentcolor 70%, transparent);
48
+ text-underline-offset: var(--f-link-underline-offset);
49
+ }
50
+ }
@@ -2,9 +2,9 @@
2
2
  .f-preview-group {
3
3
  display: flex;
4
4
  justify-content: flex-start;
5
- align-items: normal;
5
+ align-items: stretch;
6
6
  flex-wrap: wrap;
7
- gap: 32px;
7
+ gap: 24px;
8
8
  pointer-events: all;
9
9
  overflow: hidden;
10
10
  }