@sveltia/ui 0.41.5 → 0.42.0

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.
Files changed (76) hide show
  1. package/dist/components/alert/alert.svelte +36 -30
  2. package/dist/components/alert/infobar.svelte +55 -45
  3. package/dist/components/bottom-navigation/bottom-navigation.svelte +21 -15
  4. package/dist/components/button/button-group.svelte +7 -5
  5. package/dist/components/button/button.svelte +274 -175
  6. package/dist/components/button/floating-action-button-wrapper.svelte +23 -18
  7. package/dist/components/button/select-button-group.svelte +57 -41
  8. package/dist/components/button/split-button.svelte +25 -18
  9. package/dist/components/calendar/calendar.svelte +103 -80
  10. package/dist/components/checkbox/checkbox-group.svelte +22 -19
  11. package/dist/components/checkbox/checkbox.svelte +91 -63
  12. package/dist/components/dialog/dialog.svelte +105 -87
  13. package/dist/components/dialog/prompt-dialog.svelte +5 -3
  14. package/dist/components/disclosure/disclosure.svelte +34 -21
  15. package/dist/components/divider/divider.svelte +18 -14
  16. package/dist/components/divider/spacer.svelte +13 -8
  17. package/dist/components/drawer/drawer.svelte +343 -190
  18. package/dist/components/grid/grid-body.svelte +16 -14
  19. package/dist/components/grid/grid-cell.svelte +5 -3
  20. package/dist/components/grid/grid-col-header.svelte +5 -3
  21. package/dist/components/grid/grid-foot.svelte +5 -3
  22. package/dist/components/grid/grid-head.svelte +5 -3
  23. package/dist/components/grid/grid-row-header.svelte +6 -4
  24. package/dist/components/grid/grid-row.svelte +6 -4
  25. package/dist/components/grid/grid.svelte +18 -12
  26. package/dist/components/icon/icon.svelte +7 -5
  27. package/dist/components/listbox/listbox.svelte +78 -61
  28. package/dist/components/listbox/option-group.svelte +15 -11
  29. package/dist/components/listbox/option.svelte +54 -39
  30. package/dist/components/menu/menu-item-group.svelte +5 -3
  31. package/dist/components/menu/menu-item.svelte +67 -51
  32. package/dist/components/menu/menu.svelte +21 -17
  33. package/dist/components/progressbar/progressbar.svelte +24 -15
  34. package/dist/components/radio/radio-group.svelte +40 -31
  35. package/dist/components/radio/radio.svelte +81 -63
  36. package/dist/components/resizable-pane/resizable-handle.svelte +60 -48
  37. package/dist/components/resizable-pane/resizable-pane-group.svelte +18 -14
  38. package/dist/components/select/combobox.svelte +135 -112
  39. package/dist/components/select/select-tags.svelte +73 -57
  40. package/dist/components/slider/slider.svelte +94 -74
  41. package/dist/components/switch/switch.svelte +115 -81
  42. package/dist/components/table/table-body.svelte +16 -14
  43. package/dist/components/table/table-cell.svelte +5 -3
  44. package/dist/components/table/table-col-header.svelte +5 -3
  45. package/dist/components/table/table-foot.svelte +5 -3
  46. package/dist/components/table/table-head.svelte +5 -3
  47. package/dist/components/table/table-row-header.svelte +6 -4
  48. package/dist/components/table/table-row.svelte +6 -4
  49. package/dist/components/table/table.svelte +18 -12
  50. package/dist/components/tabs/tab-box.svelte +9 -6
  51. package/dist/components/tabs/tab-list.svelte +91 -73
  52. package/dist/components/tabs/tab-panel.svelte +11 -7
  53. package/dist/components/tabs/tab-panels.svelte +19 -14
  54. package/dist/components/text-editor/code-editor.svelte +10 -7
  55. package/dist/components/text-editor/lexical-root.svelte +221 -160
  56. package/dist/components/text-editor/text-editor.svelte +25 -18
  57. package/dist/components/text-editor/toolbar/toolbar-wrapper.svelte +44 -37
  58. package/dist/components/text-field/number-input.svelte +87 -68
  59. package/dist/components/text-field/password-input.svelte +52 -42
  60. package/dist/components/text-field/search-bar.svelte +64 -53
  61. package/dist/components/text-field/secret-input.svelte +61 -46
  62. package/dist/components/text-field/text-area.svelte +80 -68
  63. package/dist/components/text-field/text-input.svelte +138 -106
  64. package/dist/components/toast/toast.svelte +104 -89
  65. package/dist/components/toolbar/toolbar.svelte +70 -54
  66. package/dist/components/typography/truncated-text.svelte +9 -7
  67. package/dist/components/util/app-shell.svelte +40 -493
  68. package/dist/components/util/empty-state.svelte +13 -11
  69. package/dist/components/util/group.svelte +5 -3
  70. package/dist/components/util/modal.svelte +59 -48
  71. package/dist/components/util/popup.svelte +87 -67
  72. package/dist/index.d.ts +1 -0
  73. package/dist/index.js +1 -4
  74. package/dist/services/i18n.d.ts +6 -0
  75. package/dist/services/i18n.js +19 -14
  76. package/package.json +20 -20
@@ -33,9 +33,12 @@
33
33
  {@render children?.()}
34
34
  </div>
35
35
 
36
- <style>.tab-box {
37
- display: flex;
38
- }
39
- .tab-box.vertical {
40
- flex-direction: column;
41
- }</style>
36
+ <style lang="scss">
37
+ .tab-box {
38
+ display: flex;
39
+
40
+ &.vertical {
41
+ flex-direction: column;
42
+ }
43
+ }
44
+ </style>
@@ -119,76 +119,94 @@
119
119
  <div role="none" class="indicator" style={indicatorStyle}></div>
120
120
  </div>
121
121
 
122
- <style>.tab-list {
123
- flex: none;
124
- position: relative;
125
- display: flex;
126
- align-items: center;
127
- margin: var(--sui-tab-list-margin, var(--sui-focus-ring-width));
128
- border-color: var(--sui-tab-list-border-color, var(--sui-control-border-color));
129
- border-radius: var(--sui-tab-list-border-radius, 0);
130
- background-color: var(--sui-tab-list-background-color, transparent);
131
- }
132
- .tab-list[aria-orientation=horizontal] {
133
- gap: var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));
134
- margin-block: var(--sui-horizontal-tab-list-margin-block, 0 32px);
135
- margin-inline: var(--sui-horizontal-tab-list-margin-inline, 0);
136
- border-block-width: var(--sui-horizontal-tab-list-border-block-width, 0 1px);
137
- border-inline-width: var(--sui-horizontal-tab-list-border-inline-width, 0 0);
138
- padding: var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));
139
- }
140
- .tab-list[aria-orientation=horizontal] :global(button) {
141
- width: var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));
142
- height: var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));
143
- justify-content: var(--sui-horizontal-tab-justify-content, center);
144
- }
145
- .tab-list[aria-orientation=horizontal] .indicator {
146
- border-block-width: var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);
147
- border-inline-width: var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);
148
- }
149
- .tab-list[aria-orientation=vertical] {
150
- gap: var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));
151
- flex-direction: column;
152
- margin-block: var(--sui-vertical-tab-list-margin-block, 0);
153
- margin-inline: var(--sui-vertical-tab-list-margin-inline, 0 32px);
154
- border-block-width: var(--sui-vertical-tab-list-border-block-width, 0 0);
155
- border-inline-width: var(--sui-vertical-tab-list-border-inline-width, 0 1px);
156
- padding: var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));
157
- width: var(--sui-vertical-tab-list-width, auto);
158
- }
159
- .tab-list[aria-orientation=vertical] :global(button) {
160
- justify-content: var(--sui-vertical-tab-justify-content, flex-start);
161
- padding-inline-end: 32px;
162
- width: var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));
163
- height: var(--sui-vertical-tab-height, var(--sui-tab-height, auto));
164
- }
165
- .tab-list[aria-orientation=vertical] .indicator {
166
- border-block-width: var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);
167
- border-inline-width: var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);
168
- }
169
- .tab-list :global(button) {
170
- position: relative;
171
- z-index: 1;
172
- border-color: transparent;
173
- margin: 0 !important;
174
- border-radius: var(--sui-tab-border-radius, 0);
175
- font-family: var(--sui-tab-font-family, var(--sui-control-font-family, inherit));
176
- font-size: var(--sui-tab-font-size, var(--sui-control-font-size, inherit));
177
- font-weight: var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));
178
- }
179
-
180
- .inner {
181
- display: contents;
182
- }
183
-
184
- .indicator {
185
- position: absolute;
186
- z-index: 0;
187
- inset: auto;
188
- border-radius: var(--sui-tab-list-indicator-border-radius, 0);
189
- border-color: var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));
190
- background-color: var(--sui-tab-list-indicator-background-color, transparent);
191
- box-shadow: var(--sui-tab-list-indicator-box-shadow, none);
192
- pointer-events: none;
193
- transition: var(--sui-tab-list-indicator-transition, all 200ms);
194
- }</style>
122
+ <style lang="scss">
123
+ .tab-list {
124
+ flex: none;
125
+ position: relative;
126
+ display: flex;
127
+ align-items: center;
128
+ margin: var(--sui-tab-list-margin, var(--sui-focus-ring-width));
129
+ border-color: var(--sui-tab-list-border-color, var(--sui-control-border-color));
130
+ border-radius: var(--sui-tab-list-border-radius, 0);
131
+ background-color: var(--sui-tab-list-background-color, transparent);
132
+
133
+ &[aria-orientation='horizontal'] {
134
+ gap: var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));
135
+ margin-block: var(--sui-horizontal-tab-list-margin-block, 0 32px);
136
+ margin-inline: var(--sui-horizontal-tab-list-margin-inline, 0);
137
+ border-block-width: var(--sui-horizontal-tab-list-border-block-width, 0 1px);
138
+ border-inline-width: var(--sui-horizontal-tab-list-border-inline-width, 0 0);
139
+ padding: var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));
140
+
141
+ :global {
142
+ button {
143
+ width: var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));
144
+ height: var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));
145
+ justify-content: var(--sui-horizontal-tab-justify-content, center);
146
+ }
147
+ }
148
+
149
+ .indicator {
150
+ border-block-width: var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);
151
+ border-inline-width: var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);
152
+ }
153
+ }
154
+
155
+ &[aria-orientation='vertical'] {
156
+ gap: var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));
157
+ flex-direction: column;
158
+ margin-block: var(--sui-vertical-tab-list-margin-block, 0);
159
+ margin-inline: var(--sui-vertical-tab-list-margin-inline, 0 32px);
160
+ border-block-width: var(--sui-vertical-tab-list-border-block-width, 0 0);
161
+ border-inline-width: var(--sui-vertical-tab-list-border-inline-width, 0 1px);
162
+ padding: var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));
163
+ width: var(--sui-vertical-tab-list-width, auto);
164
+
165
+ :global {
166
+ button {
167
+ justify-content: var(--sui-vertical-tab-justify-content, flex-start);
168
+ padding-inline-end: 32px;
169
+ width: var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));
170
+ height: var(--sui-vertical-tab-height, var(--sui-tab-height, auto));
171
+ }
172
+ }
173
+
174
+ .indicator {
175
+ border-block-width: var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);
176
+ border-inline-width: var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);
177
+ }
178
+ }
179
+
180
+ :global {
181
+ button {
182
+ position: relative;
183
+ z-index: 1;
184
+ border-color: transparent;
185
+ margin: 0 !important;
186
+ border-radius: var(--sui-tab-border-radius, 0);
187
+ font-family: var(--sui-tab-font-family, var(--sui-control-font-family, inherit));
188
+ font-size: var(--sui-tab-font-size, var(--sui-control-font-size, inherit));
189
+ font-weight: var(
190
+ --sui-tab-font-weight,
191
+ var(--sui-control-font-weight, var(--sui-font-weight-normal, normal))
192
+ );
193
+ }
194
+ }
195
+ }
196
+
197
+ .inner {
198
+ display: contents;
199
+ }
200
+
201
+ .indicator {
202
+ position: absolute;
203
+ z-index: 0;
204
+ inset: auto;
205
+ border-radius: var(--sui-tab-list-indicator-border-radius, 0);
206
+ border-color: var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));
207
+ background-color: var(--sui-tab-list-indicator-background-color, transparent);
208
+ box-shadow: var(--sui-tab-list-indicator-box-shadow, none);
209
+ pointer-events: none;
210
+ transition: var(--sui-tab-list-indicator-transition, all 200ms);
211
+ }
212
+ </style>
@@ -31,10 +31,14 @@
31
31
  {@render children?.()}
32
32
  </div>
33
33
 
34
- <style>.tab-panel {
35
- flex: auto;
36
- transition: all 200ms;
37
- }
38
- .tab-panel[aria-hidden=true], .tab-panel:not([aria-hidden]) {
39
- display: none;
40
- }</style>
34
+ <style lang="scss">
35
+ .tab-panel {
36
+ flex: auto;
37
+ transition: all 200ms;
38
+
39
+ &[aria-hidden='true'],
40
+ &:not([aria-hidden]) {
41
+ display: none;
42
+ }
43
+ }
44
+ </style>
@@ -30,17 +30,22 @@
30
30
  {@render children?.()}
31
31
  </div>
32
32
 
33
- <style>.tab-panels {
34
- flex: auto;
35
- display: flex;
36
- gap: var(--sui-tab-panels-gap, 16px);
37
- overflow: hidden;
38
- scroll-snap-type: x mandatory;
39
- }
40
- .tab-panels > :global(.tab-panel) {
41
- flex: none;
42
- display: block !important;
43
- width: 100%;
44
- overflow: auto;
45
- scroll-snap-align: center;
46
- }</style>
33
+ <style lang="scss">
34
+ .tab-panels {
35
+ flex: auto;
36
+ display: flex;
37
+ gap: var(--sui-tab-panels-gap, 16px);
38
+ overflow: hidden;
39
+ scroll-snap-type: x mandatory;
40
+
41
+ :global {
42
+ & > .tab-panel {
43
+ flex: none;
44
+ display: block !important;
45
+ width: 100%;
46
+ overflow: auto;
47
+ scroll-snap-align: center;
48
+ }
49
+ }
50
+ }
51
+ </style>
@@ -117,10 +117,13 @@
117
117
  </Toast>
118
118
  {/if}
119
119
 
120
- <style>.code-editor {
121
- margin: var(--sui-focus-ring-width);
122
- width: calc(100% - var(--sui-focus-ring-width) * 2);
123
- }
124
- .code-editor.flex:not([hidden]) {
125
- display: block;
126
- }</style>
120
+ <style lang="scss">
121
+ .code-editor {
122
+ margin: var(--sui-focus-ring-width);
123
+ width: calc(100% - var(--sui-focus-ring-width) * 2);
124
+
125
+ &.flex:not([hidden]) {
126
+ display: block; // Avoid Tailwind .flex class collisions
127
+ }
128
+ }
129
+ </style>
@@ -131,163 +131,224 @@
131
131
  {hidden}
132
132
  ></div>
133
133
 
134
- <style>.lexical-root {
135
- overflow: hidden;
136
- border: 1px solid var(--sui-textbox-border-color);
137
- border-radius: var(--sui-textbox-border-radius) !important;
138
- padding: var(--sui-textbox-multiline-padding);
139
- min-height: 8em;
140
- color: var(--sui-textbox-foreground-color);
141
- background-color: var(--sui-textbox-background-color);
142
- font-family: var(--sui-textbox-font-family);
143
- font-size: var(--sui-textbox-font-size);
144
- line-height: var(--sui-textbox-multiline-line-height);
145
- }
146
- .lexical-root:not(:first-child) {
147
- border-start-start-radius: 0 !important;
148
- border-start-end-radius: 0 !important;
149
- }
150
- .lexical-root.code {
151
- padding: 0;
152
- }
153
- .lexical-root.code :global(.code-block) {
154
- border-radius: 0 !important;
155
- min-height: 120px;
156
- }
157
- .lexical-root:focus-visible {
158
- outline: 0;
159
- }
160
- .lexical-root[aria-invalid=true] {
161
- border-color: var(--sui-error-border-color);
162
- }
163
- .lexical-root :global([dir]:first-child) {
164
- margin-top: 0;
165
- }
166
- .lexical-root :global([dir]:last-child) {
167
- margin-bottom: 0;
168
- }
169
- .lexical-root :global(strong.italic) {
170
- font-style: italic;
171
- }
172
- .lexical-root :global(.strikethrough) {
173
- text-decoration: line-through;
174
- }
175
- .lexical-root :global(li.nested) {
176
- list-style-type: none;
177
- }
178
- .lexical-root :global(.code-block) {
179
- position: relative;
180
- display: block;
181
- padding-block: 8px;
182
- padding-inline-start: 56px;
183
- padding-inline-end: 8px;
184
- background-color: var(--sui-code-background-color);
185
- overflow-x: auto;
186
- white-space: pre;
187
- }
188
- .lexical-root :global(.code-block:not(:first-child)) {
189
- margin-top: 1em;
190
- }
191
- .lexical-root :global(.code-block:not(:last-child)) {
192
- margin-bottom: 1em;
193
- }
194
- .lexical-root :global(.code-block::before) {
195
- position: absolute;
196
- inset-block: 0;
197
- inset-inline-start: 0;
198
- inset-inline-end: auto;
199
- content: attr(data-gutter);
200
- padding: 8px;
201
- min-width: 40px;
202
- color: var(--sui-tertiary-foreground-color);
203
- background-color: var(--sui-tertiary-background-color);
204
- text-align: end;
205
- }
206
- .lexical-root :global([data-lexical-text=true]) {
207
- cursor: text;
208
- }
209
- .lexical-root :global(:is(th, td)) > :global(p) {
210
- margin: 0;
211
- white-space: normal;
212
- word-break: normal;
213
- }
214
- .lexical-root :global(hr) {
215
- margin: var(--sui-paragraph-margin) 0;
216
- border: none;
217
- padding: 0;
218
- }
219
- .lexical-root :global(hr::after) {
220
- display: block;
221
- height: 2px;
222
- background-color: var(--sui-control-border-color);
223
- line-height: 2px;
224
- content: "";
225
- }
226
-
227
- :root[data-theme=light] .lexical-root :global(.token:is(.comment, .prolog, .doctype, .cdata)) {
228
- color: slategray;
229
- }
230
- :root[data-theme=light] .lexical-root :global(.token.punctuation) {
231
- color: #999;
232
- }
233
- :root[data-theme=light] .lexical-root :global(.token.namespace) {
234
- opacity: 0.7;
235
- }
236
- :root[data-theme=light] .lexical-root :global(.token:is(.property, .tag, .boolean, .number, .constant, .symbol, .deleted)) {
237
- color: #905;
238
- }
239
- :root[data-theme=light] .lexical-root :global(.token:is(.selector, .attr-name, .string, .char, .builtin, .inserted)) {
240
- color: #690;
241
- }
242
- :root[data-theme=light] .lexical-root :global(.token:is(.operator, .entity, .url)), :root[data-theme=light] .lexical-root :global(.language-css) :global(.token.string), :root[data-theme=light] .lexical-root :global(.style) :global(.token.string) {
243
- color: #9a6e3a;
244
- }
245
- :root[data-theme=light] .lexical-root :global(.token:is(.atrule, .attr-value, .keyword)) {
246
- color: #07a;
247
- }
248
- :root[data-theme=light] .lexical-root :global(.token:is(.function, .class-name)) {
249
- color: #dd4a68;
250
- }
251
- :root[data-theme=light] .lexical-root :global(.token:is(.regex, .important, .variable)) {
252
- color: #e90;
253
- }
254
-
255
- :root[data-theme=dark] .lexical-root :global(.token:is(.comment, .block-comment, .prolog, .doctype, .cdata)) {
256
- color: #999;
257
- }
258
- :root[data-theme=dark] .lexical-root :global(.token.punctuation) {
259
- color: #ccc;
260
- }
261
- :root[data-theme=dark] .lexical-root :global(.token:is(.tag, .attr-name, .namespace, .deleted)) {
262
- color: #e2777a;
263
- }
264
- :root[data-theme=dark] .lexical-root :global(.token.function-name) {
265
- color: #6196cc;
266
- }
267
- :root[data-theme=dark] .lexical-root :global(.token:is(.boolean, .number, .function)) {
268
- color: #f08d49;
269
- }
270
- :root[data-theme=dark] .lexical-root :global(.token:is(.property, .class-name, .constant, .symbol)) {
271
- color: #f8c555;
272
- }
273
- :root[data-theme=dark] .lexical-root :global(.token:is(.selector, .important, .atrule, .keyword, .builtin)) {
274
- color: #cc99cd;
275
- }
276
- :root[data-theme=dark] .lexical-root :global(.token:is(.string, .char, .attr-value, .regex, .variable)) {
277
- color: #7ec699;
278
- }
279
- :root[data-theme=dark] .lexical-root :global(.token:is(.operator, .entity, .url)) {
280
- color: #67cdcc;
281
- }
282
- :root[data-theme=dark] .lexical-root :global(.token:is(.important, .bold)) {
283
- font-weight: bold;
284
- }
285
- :root[data-theme=dark] .lexical-root :global(.token.italic) {
286
- font-style: italic;
287
- }
288
- :root[data-theme=dark] .lexical-root :global(.token.entity) {
289
- cursor: help;
290
- }
291
- :root[data-theme=dark] .lexical-root :global(.token.inserted) {
292
- color: green;
293
- }</style>
134
+ <style lang="scss">
135
+ .lexical-root {
136
+ overflow: hidden;
137
+ border: 1px solid var(--sui-textbox-border-color);
138
+ border-radius: var(--sui-textbox-border-radius) !important;
139
+ padding: var(--sui-textbox-multiline-padding);
140
+ min-height: 8em;
141
+ color: var(--sui-textbox-foreground-color);
142
+ background-color: var(--sui-textbox-background-color);
143
+ font-family: var(--sui-textbox-font-family);
144
+ font-size: var(--sui-textbox-font-size);
145
+ line-height: var(--sui-textbox-multiline-line-height);
146
+
147
+ &:not(:first-child) {
148
+ border-start-start-radius: 0 !important;
149
+ border-start-end-radius: 0 !important;
150
+ }
151
+
152
+ &.code {
153
+ padding: 0;
154
+
155
+ :global {
156
+ .code-block {
157
+ border-radius: 0 !important;
158
+ min-height: 120px;
159
+ }
160
+ }
161
+ }
162
+
163
+ &:focus-visible {
164
+ outline: 0;
165
+ }
166
+
167
+ &[aria-invalid='true'] {
168
+ border-color: var(--sui-error-border-color);
169
+ }
170
+
171
+ :global {
172
+ // Remove the default margin on the first and last child elements of block nodes, including
173
+ // paragraphs, headings, lists, and code blocks, but keep the default margin on other items,
174
+ // including UI widgets like radio buttons, checkboxes, and select menus
175
+ [dir] {
176
+ &:first-child {
177
+ margin-top: 0;
178
+ }
179
+
180
+ &:last-child {
181
+ margin-bottom: 0;
182
+ }
183
+ }
184
+
185
+ strong.italic {
186
+ font-style: italic;
187
+ }
188
+
189
+ .strikethrough {
190
+ text-decoration: line-through;
191
+ }
192
+
193
+ li.nested {
194
+ list-style-type: none;
195
+ }
196
+
197
+ .code-block {
198
+ position: relative;
199
+ display: block;
200
+ padding-block: 8px;
201
+ padding-inline-start: 56px;
202
+ padding-inline-end: 8px;
203
+ background-color: var(--sui-code-background-color);
204
+ overflow-x: auto;
205
+ white-space: pre;
206
+
207
+ &:not(:first-child) {
208
+ margin-top: 1em;
209
+ }
210
+
211
+ &:not(:last-child) {
212
+ margin-bottom: 1em;
213
+ }
214
+
215
+ &::before {
216
+ position: absolute;
217
+ inset-block: 0;
218
+ inset-inline-start: 0;
219
+ inset-inline-end: auto;
220
+ content: attr(data-gutter);
221
+ padding: 8px;
222
+ min-width: 40px;
223
+ color: var(--sui-tertiary-foreground-color);
224
+ background-color: var(--sui-tertiary-background-color);
225
+ text-align: end;
226
+ }
227
+ }
228
+
229
+ [data-lexical-text='true'] {
230
+ cursor: text;
231
+ }
232
+
233
+ :is(th, td) > p {
234
+ margin: 0;
235
+ white-space: normal;
236
+ word-break: normal;
237
+ }
238
+
239
+ hr {
240
+ margin: var(--sui-paragraph-margin) 0;
241
+ border: none;
242
+ padding: 0;
243
+
244
+ &::after {
245
+ display: block;
246
+ height: 2px;
247
+ background-color: var(--sui-control-border-color);
248
+ line-height: 2px;
249
+ content: '';
250
+ }
251
+ }
252
+ }
253
+ }
254
+
255
+ // Part of the Default Prism theme
256
+ :root[data-theme='light'] .lexical-root {
257
+ :global {
258
+ .token:is(.comment, .prolog, .doctype, .cdata) {
259
+ color: slategray;
260
+ }
261
+
262
+ .token.punctuation {
263
+ color: #999;
264
+ }
265
+
266
+ .token.namespace {
267
+ opacity: 0.7;
268
+ }
269
+
270
+ .token:is(.property, .tag, .boolean, .number, .constant, .symbol, .deleted) {
271
+ color: #905;
272
+ }
273
+
274
+ .token:is(.selector, .attr-name, .string, .char, .builtin, .inserted) {
275
+ color: #690;
276
+ }
277
+
278
+ .token:is(.operator, .entity, .url),
279
+ .language-css .token.string,
280
+ .style .token.string {
281
+ color: #9a6e3a;
282
+ }
283
+
284
+ .token:is(.atrule, .attr-value, .keyword) {
285
+ color: #07a;
286
+ }
287
+
288
+ .token:is(.function, .class-name) {
289
+ color: #dd4a68;
290
+ }
291
+
292
+ .token:is(.regex, .important, .variable) {
293
+ color: #e90;
294
+ }
295
+ }
296
+ }
297
+
298
+ // Part of the Tomorrow Night Prism theme
299
+ :root[data-theme='dark'] .lexical-root {
300
+ :global {
301
+ .token:is(.comment, .block-comment, .prolog, .doctype, .cdata) {
302
+ color: #999;
303
+ }
304
+
305
+ .token.punctuation {
306
+ color: #ccc;
307
+ }
308
+
309
+ .token:is(.tag, .attr-name, .namespace, .deleted) {
310
+ color: #e2777a;
311
+ }
312
+
313
+ .token.function-name {
314
+ color: #6196cc;
315
+ }
316
+
317
+ .token:is(.boolean, .number, .function) {
318
+ color: #f08d49;
319
+ }
320
+
321
+ .token:is(.property, .class-name, .constant, .symbol) {
322
+ color: #f8c555;
323
+ }
324
+
325
+ .token:is(.selector, .important, .atrule, .keyword, .builtin) {
326
+ color: #cc99cd;
327
+ }
328
+
329
+ .token:is(.string, .char, .attr-value, .regex, .variable) {
330
+ color: #7ec699;
331
+ }
332
+
333
+ .token:is(.operator, .entity, .url) {
334
+ color: #67cdcc;
335
+ }
336
+
337
+ .token:is(.important, .bold) {
338
+ font-weight: bold;
339
+ }
340
+
341
+ .token.italic {
342
+ font-style: italic;
343
+ }
344
+
345
+ .token.entity {
346
+ cursor: help;
347
+ }
348
+
349
+ .token.inserted {
350
+ color: green;
351
+ }
352
+ }
353
+ }
354
+ </style>