@foblex/m-render 3.0.5 → 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,89 +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: 40px;
13
- font-size: 28px;
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: 48px 0 16px;
18
- border-top: 1px solid var(--divider-color);
19
- padding-top: 24px;
20
- letter-spacing: -0.02em;
21
- line-height: 32px;
22
- font-size: 24px;
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: 32px 0 0;
27
- letter-spacing: -0.01em;
28
- line-height: 28px;
29
- font-size: 20px;
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: 24px;
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: 40px;
43
- font-size: 32px;
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: 28px;
48
+ p, summary {
49
+ margin: 1em 0;
50
+ line-height: 1.5;
55
51
  }
56
52
 
57
- blockquote {
58
- margin: 16px 0;
59
- border-left: 2px solid var(--divider-color);
60
- padding-left: 16px;
61
- color: var(--secondary-text);
53
+ strong {
54
+ font-weight: 600;
62
55
  }
63
56
 
64
- blockquote > p {
65
- margin: 0;
66
- font-size: 16px;
57
+ em {
58
+ font-style: italic;
67
59
  }
68
60
 
69
- a {
70
- font-weight: 500;
71
- color: var(--primary-1);
72
- text-decoration: underline;
73
- text-underline-offset: 2px;
61
+ ul, ol {
62
+ margin: 0.5em 0 1em;
63
+ padding-left: 1.625em;
74
64
 
75
- &:hover {
76
- color: var(--primary-2);
65
+ > li > :first-child {
66
+ margin-top: 0;
67
+ margin-bottom: 0;
77
68
  }
78
- }
79
69
 
80
- strong {
81
- font-weight: 600;
82
- }
83
-
84
- ul, ol {
85
- padding-left: 1.25rem;
86
- margin: 16px 0;
70
+ > li ul,
71
+ > li ol {
72
+ margin-top: 0.25em !important;
73
+ }
87
74
  }
88
75
 
89
76
  ul {
@@ -94,31 +81,69 @@
94
81
  list-style: decimal;
95
82
  }
96
83
 
97
- li + li {
98
- 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
+ }
94
+ }
95
+
96
+ li {
97
+ min-height: 1.5em;
98
+ margin: 0.5em 0;
99
99
  }
100
100
 
101
- li > ol, li > ul {
102
- margin: 8px 0 0;
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
+ }
103
127
  }
104
128
 
105
129
  hr {
106
- margin: 16px 0;
130
+ margin: 2em 0;
107
131
  border: none;
108
- border-top: 1px solid var(--divider-color);
132
+ border-top: 1px solid var(--doc-divider-color);
109
133
  }
110
134
 
111
135
  :not(pre) > code {
112
- font-size: var(--not-pre-code-font-size);
113
- color: var(--not-pre-code-color);
114
- border-radius: var(--border-radius);
115
- padding: 3px 6px;
136
+ padding: 1px 0.3rem;
137
+ border-radius: 0.25rem;
116
138
  background-color: var(--not-pre-code-background);
117
-
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;
118
146
  word-wrap: break-word;
119
147
  word-break: break-word;
120
- white-space: pre-wrap;
121
148
  }
122
149
  }
123
-
124
-
@@ -1,7 +1,8 @@
1
1
  :root {
2
- --copy-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' 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
- --fullscreen-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' 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
- --fullscreen-exit-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' 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");
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");
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");
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
  }
6
7
 
7
8
  .f-icon {
@@ -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
  }
@@ -1,51 +1,63 @@
1
- .m-render {
2
-
1
+ .m-render .doc-content {
3
2
  table {
4
3
  width: 100%;
5
- border-collapse: collapse;
6
- font-size: 14px;
7
- line-height: 1.6;
8
- margin: 16px 0;
4
+ margin: 2em 0;
5
+ border: 0;
6
+ border-collapse: separate;
7
+ border-spacing: 0;
8
+ table-layout: auto;
9
+ font-size: 0.875em;
10
+ line-height: 1.7142857;
9
11
 
10
- thead {
11
- background-color: var(--alt-background);
12
+ th {
13
+ border: 0;
14
+ border-bottom: 1px solid var(--dark-divider-color);
15
+ padding-block: 8px;
16
+ padding-inline: 8px;
12
17
  color: var(--primary-text);
18
+ font-weight: 600;
19
+ line-height: 20px;
20
+ text-align: start;
21
+
22
+ &:first-child {
23
+ padding-inline-start: 0;
24
+ }
25
+
26
+ &:last-child {
27
+ padding-inline-end: 0;
28
+ }
13
29
  }
14
30
 
15
- th,
16
31
  td {
17
- padding: 12px 16px;
18
- text-align: left;
32
+ border: 0;
19
33
  border-bottom: 1px solid var(--divider-color);
34
+ padding-block: 10px;
35
+ padding-inline: 8px;
20
36
  color: var(--primary-text);
21
- }
22
-
23
- th {
24
- font-weight: 600;
25
- }
37
+ background: none;
26
38
 
27
- tr {
28
- background-color: var(--background-color);
39
+ &:first-child {
40
+ padding-inline-start: 0;
41
+ }
29
42
 
30
- &:hover {
31
- background-color: var(--soft-background);
43
+ &:last-child {
44
+ padding-inline-end: 0;
32
45
  }
33
46
  }
34
47
 
48
+ tbody tr:last-child td {
49
+ border-bottom: 0;
50
+ }
51
+
35
52
  code {
36
53
  font-family: var(--font-family-mono);
37
- font-size: 0.875em;
54
+ font-size: var(--not-pre-code-font-size);
38
55
  background-color: var(--not-pre-code-background);
39
- color: var(--not-pre-code-color);
40
- padding: 0.2em 0.4em;
41
- border-radius: var(--border-radius);
56
+ box-shadow: inset 0 0 0 1px var(--not-pre-code-border-color);
57
+ color: inherit;
58
+ padding: 1px 0.3rem;
59
+ border-radius: 0.25rem;
60
+ font-weight: 500;
42
61
  }
43
62
  }
44
-
45
- table:not([class]) {
46
- display: table;
47
- width: 100%;
48
- overflow-x: auto;
49
- max-width: 100%;
50
- }
51
63
  }