@streamscloud/kit 0.92.0 → 0.92.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.
@@ -8,29 +8,30 @@ export {};
8
8
 
9
9
  <!--
10
10
  @component
11
- A scoped style wrapper for arbitrary HTML — applies typographic and list-style defaults to descendant
12
- `h1`–`h6`, `a`, `pre`, `ul`, `ol`, `table` produced by an external HTML source (rich-text editor,
13
- markdown renderer, server-rendered email body). The wrapper itself is `display: contents` so layout is
14
- unaffected.
11
+ A scoped style wrapper for arbitrary HTML — gives reading typography, vertical rhythm, list markers, tables,
12
+ blockquotes, inline code, code blocks and `hr` to the markup of an external HTML source (rich-text editor,
13
+ markdown renderer, server-rendered email body). All spacing scales with the base font size; a wide table is
14
+ not scrolled horizontally.
15
15
 
16
16
  ### CSS Custom Properties
17
17
  | Property | Description | Default |
18
18
  |---|---|---|
19
+ | `--sc-kit--html-block--font-size` | Base font size | `0.875em` |
19
20
  | `--sc-kit--html-block--text-color` | Body text color | `--sc-kit--color--text--primary` |
20
21
  | `--sc-kit--html-block--link-color` | Anchor color | `--sc-kit--color--accent` |
21
- | `--sc-kit--html-block--code-font` | Monospace font for `pre` | `--sc-kit--font--mono` |
22
+ | `--sc-kit--html-block--code-font` | Monospace font for `pre` and `code` | `--sc-kit--font--mono` |
22
23
  -->
23
24
 
24
25
  <style>.html-block {
25
26
  --_html-block--text: var(--sc-kit--html-block--text-color, var(--sc-kit--color--text--primary));
26
27
  --_html-block--link: var(--sc-kit--html-block--link-color, var(--sc-kit--color--accent));
27
28
  --_html-block--code-font: var(--sc-kit--html-block--code-font, var(--sc-kit--font--mono));
28
- display: contents;
29
- overflow-wrap: anywhere;
30
- font-size: 0.875em;
31
- line-height: var(--sc-kit--leading--normal);
32
- font-weight: normal;
29
+ --_html-block--font-size: var(--sc-kit--html-block--font-size, 0.875em);
30
+ display: block;
31
+ font-size: var(--_html-block--font-size);
32
+ line-height: var(--sc-kit--leading--relaxed);
33
33
  color: var(--_html-block--text);
34
+ overflow-wrap: anywhere;
34
35
  }
35
36
  .html-block :global(p),
36
37
  .html-block :global(h1),
@@ -41,99 +42,143 @@ unaffected.
41
42
  .html-block :global(h6) {
42
43
  overflow-wrap: inherit;
43
44
  }
45
+ .html-block :global(p),
46
+ .html-block :global(ul),
47
+ .html-block :global(ol),
48
+ .html-block :global(table),
49
+ .html-block :global(blockquote),
50
+ .html-block :global(pre),
51
+ .html-block :global(hr) {
52
+ margin: 0 0 1em;
53
+ }
54
+ .html-block :global(h1),
55
+ .html-block :global(h2),
56
+ .html-block :global(h3),
57
+ .html-block :global(h4),
58
+ .html-block :global(h5),
59
+ .html-block :global(h6) {
60
+ margin: 1.5em 0 0.5em;
61
+ font-size: 1em;
62
+ font-weight: var(--sc-kit--font-weight--semibold);
63
+ line-height: var(--sc-kit--leading--tight);
64
+ color: var(--_html-block--text);
65
+ }
44
66
  .html-block :global(h1) {
67
+ margin: 1em 0 0.3333333333em;
45
68
  font-size: 1.5em;
46
- line-height: var(--sc-kit--leading--normal);
47
- font-weight: 600;
48
- color: var(--_html-block--text);
49
69
  }
50
70
  .html-block :global(h2) {
51
- font-size: 1.375em;
52
- line-height: var(--sc-kit--leading--normal);
53
- font-weight: 600;
54
- color: var(--_html-block--text);
71
+ margin: 1.2em 0 0.4em;
72
+ font-size: 1.25em;
55
73
  }
56
74
  .html-block :global(h3) {
57
- font-size: 1.25em;
58
- line-height: var(--sc-kit--leading--normal);
59
- font-weight: 600;
60
- color: var(--_html-block--text);
75
+ margin: 1.3333333333em 0 0.4444444444em;
76
+ font-size: 1.125em;
61
77
  }
62
78
  .html-block :global(h4) {
63
- font-size: 1.125em;
64
- line-height: var(--sc-kit--leading--normal);
65
- font-weight: 500;
66
- color: var(--_html-block--text);
79
+ margin: 1.5em 0 0.5em;
80
+ font-size: 1em;
67
81
  }
68
82
  .html-block :global(h5) {
69
- font-size: 1.0625em;
70
- line-height: var(--sc-kit--leading--normal);
71
- font-weight: 500;
72
- color: var(--_html-block--text);
83
+ margin: 1.7142857143em 0 0.5714285714em;
84
+ font-size: 0.875em;
73
85
  }
74
86
  .html-block :global(h6) {
75
- font-size: 1em;
76
- line-height: var(--sc-kit--leading--normal);
77
- font-weight: 500;
78
- color: var(--_html-block--text);
87
+ margin: 1.7142857143em 0 0.5714285714em;
88
+ font-size: 0.875em;
89
+ }
90
+ .html-block :global(h6) {
91
+ color: var(--sc-kit--color--text--secondary);
92
+ }
93
+ .html-block > :global(:first-child) {
94
+ margin-top: 0;
95
+ }
96
+ .html-block > :global(:last-child),
97
+ .html-block :global(li > :last-child),
98
+ .html-block :global(blockquote > :last-child) {
99
+ margin-bottom: 0;
79
100
  }
80
101
  .html-block :global(a) {
81
- font-size: 1em;
82
- line-height: var(--sc-kit--leading--normal);
83
- font-weight: normal;
84
- color: var(--_html-block--text);
85
102
  color: var(--_html-block--link);
86
103
  }
87
- .html-block :global(pre) {
88
- font-family: var(--_html-block--code-font);
89
- white-space: pre-wrap;
90
- margin: 1em 0;
91
- font-size: 1em;
92
- line-height: var(--sc-kit--leading--tight);
93
- font-weight: normal;
94
- color: var(--_html-block--text);
104
+ .html-block :global(ul),
105
+ .html-block :global(ol) {
106
+ padding-left: 1.5em;
95
107
  }
96
- .html-block :global(ul) :global(> li),
97
- .html-block :global(ol) :global(> li) {
98
- list-style: inherit;
99
- margin-left: 1em;
100
- position: relative;
101
- font-size: 1em;
102
- line-height: var(--sc-kit--leading--normal);
103
- font-weight: normal;
104
- color: var(--_html-block--text);
108
+ .html-block :global(ul) {
109
+ list-style-type: disc;
105
110
  }
106
111
  .html-block :global(ol) {
107
112
  list-style-type: decimal;
108
113
  }
109
- .html-block :global(ol) :global(> li > ol) {
114
+ .html-block :global(li) {
115
+ list-style: inherit;
116
+ }
117
+ .html-block :global(li + li) {
118
+ margin-top: 0.25em;
119
+ }
120
+ .html-block :global(li > ul),
121
+ .html-block :global(li > ol) {
122
+ margin-top: 0.125em;
123
+ }
124
+ .html-block :global(ul ul) {
125
+ list-style-type: circle;
126
+ }
127
+ .html-block :global(ol ol) {
110
128
  list-style-type: lower-alpha;
111
129
  }
112
130
  .html-block :global(table) {
113
131
  max-width: 100%;
132
+ border-collapse: collapse;
114
133
  }
115
- .html-block :global(table),
116
- .html-block :global(tbody),
117
- .html-block :global(thead),
118
- .html-block :global(tr),
119
134
  .html-block :global(th),
120
135
  .html-block :global(td) {
121
- border-width: initial;
122
- border-style: inherit;
123
- border-color: inherit;
124
- }
125
- .html-block :global(ul:not([style*='list-style-type'])),
126
- .html-block :global(ul:not([style*='list-style-type']) > li > ul:not([style*='list-style-type'])) {
127
- list-style-type: none;
128
- }
129
- .html-block :global(ul:not([style*='list-style-type']) > li:before),
130
- .html-block :global(ul:not([style*='list-style-type']) > li > ul:not([style*='list-style-type']) > li:before) {
131
- content: "-";
132
- text-indent: -1em;
133
- position: absolute;
134
- font-weight: bold;
135
- }
136
- .html-block :global(ul[style*='list-style-type'] > li:before),
137
- .html-block :global(ul > li > ul[style*='list-style-type'] > li:before) {
138
- content: none;
136
+ border: 1px solid var(--sc-kit--color--border);
137
+ padding: 0.5em 0.75em;
138
+ line-height: var(--sc-kit--leading--normal);
139
+ text-align: start;
140
+ vertical-align: top;
141
+ }
142
+ .html-block :global(th) {
143
+ padding: 0.4285714286em 0.8571428571em;
144
+ background: var(--sc-kit--color--bg--field-alt);
145
+ color: var(--sc-kit--color--text--secondary);
146
+ font-size: 0.875em;
147
+ font-weight: var(--sc-kit--font-weight--semibold);
148
+ vertical-align: middle;
149
+ }
150
+ .html-block :global(blockquote) {
151
+ border-left: 3px solid var(--sc-kit--color--border--strong);
152
+ padding-left: 1em;
153
+ color: var(--sc-kit--color--text--secondary);
154
+ }
155
+ .html-block :global(code) {
156
+ font-family: var(--_html-block--code-font);
157
+ font-size: 0.875em;
158
+ background: var(--sc-kit--color--bg--element);
159
+ padding: 0.125em 0.375em;
160
+ border-radius: var(--sc-kit--radius--sm);
161
+ }
162
+ .html-block :global(pre) {
163
+ font-family: var(--_html-block--code-font);
164
+ font-size: 0.875em;
165
+ line-height: var(--sc-kit--leading--normal);
166
+ background: var(--sc-kit--color--bg--element);
167
+ padding: 0.8571428571em 1.1428571429em;
168
+ border-radius: var(--sc-kit--radius--md);
169
+ overflow-x: auto;
170
+ white-space: pre;
171
+ overflow-wrap: normal;
172
+ }
173
+ .html-block :global(pre) :global(code) {
174
+ font-size: inherit;
175
+ background: none;
176
+ padding: 0;
177
+ border-radius: 0;
178
+ }
179
+ .html-block :global(hr) {
180
+ border: none;
181
+ border-top: 1px solid var(--sc-kit--color--border);
182
+ margin-top: 1.5em;
183
+ margin-bottom: 1.5em;
139
184
  }</style>
@@ -3,17 +3,18 @@ type Props = {
3
3
  children: Snippet;
4
4
  };
5
5
  /**
6
- * A scoped style wrapper for arbitrary HTML — applies typographic and list-style defaults to descendant
7
- * `h1`–`h6`, `a`, `pre`, `ul`, `ol`, `table` produced by an external HTML source (rich-text editor,
8
- * markdown renderer, server-rendered email body). The wrapper itself is `display: contents` so layout is
9
- * unaffected.
6
+ * A scoped style wrapper for arbitrary HTML — gives reading typography, vertical rhythm, list markers, tables,
7
+ * blockquotes, inline code, code blocks and `hr` to the markup of an external HTML source (rich-text editor,
8
+ * markdown renderer, server-rendered email body). All spacing scales with the base font size; a wide table is
9
+ * not scrolled horizontally.
10
10
  *
11
11
  * ### CSS Custom Properties
12
12
  * | Property | Description | Default |
13
13
  * |---|---|---|
14
+ * | `--sc-kit--html-block--font-size` | Base font size | `0.875em` |
14
15
  * | `--sc-kit--html-block--text-color` | Body text color | `--sc-kit--color--text--primary` |
15
16
  * | `--sc-kit--html-block--link-color` | Anchor color | `--sc-kit--color--accent` |
16
- * | `--sc-kit--html-block--code-font` | Monospace font for `pre` | `--sc-kit--font--mono` |
17
+ * | `--sc-kit--html-block--code-font` | Monospace font for `pre` and `code` | `--sc-kit--font--mono` |
17
18
  */
18
19
  declare const Cmp: import("svelte").Component<Props, {}, "">;
19
20
  type Cmp = ReturnType<typeof Cmp>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.92.0",
3
+ "version": "0.92.1",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",