Skip to content

Commit a7f8818

Browse files
authored
fix(html): fixed horizontal overflow in certain templates (#540)
1 parent 5048e1b commit a7f8818

File tree

4 files changed

+49
-49
lines changed

4 files changed

+49
-49
lines changed

src/html/templates/function.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{~#each overloads_ctx~}}
1010
<label for="{{this.overload_id}}" class="functionOverload">
1111
{{~> deprecated this.deprecated ~}}
12-
<code class="text-sm">
12+
<code class="text-sm break-words">
1313
<span class="font-bold">{{this.name}}</span><span class="font-medium">{{{this.summary}}} {{! typedef rendering }}</span>
1414
</code>
1515
{{~#if this.summary_doc~}}

src/html/templates/styles.css

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@ summary::-webkit-details-marker {
2424
#sidepanel {
2525
@apply shrink-0 box-border lg:h-screen lg:sticky lg:top-0 lg:left-0 lg:overflow-y-auto lg:overscroll-y-contain;
2626
scrollbar-width: thin;
27-
27+
2828
label, a, h2, h3 {
2929
@apply py-1.5 pr-4 pl-2;
3030
}
31-
31+
3232
h2 {
3333
@apply flex items-center gap-2.5 mt-2 text-xl font-bold;
3434
}
35-
35+
3636
h3 {
3737
@apply font-bold;
3838
}
39-
39+
4040
ul {
4141
@apply list-none;
4242
}
43-
43+
4444
li {
4545
@apply block;
4646
}
47-
47+
4848
a {
4949
@apply flex items-center gap-2 leading-none relative rounded-lg;
5050
}
51-
51+
5252
li > a > span {
5353
@apply block w-full overflow-hidden whitespace-nowrap text-ellipsis text-sm;
5454
}
55-
55+
5656
li > a:has(span) {
5757
@apply py-1;
5858
}
@@ -68,7 +68,7 @@ summary::-webkit-details-marker {
6868

6969
.anchorable {
7070
@apply relative;
71-
71+
7272
&:hover .anchor {
7373
@apply block;
7474
}
@@ -77,31 +77,31 @@ summary::-webkit-details-marker {
7777
.deprecated {
7878
> div:first-child {
7979
@apply py-1 text-red-500 flex gap-1 items-center;
80-
80+
8181
> span {
8282
@apply font-semibold leading-6;
8383
}
8484
}
85-
85+
8686
> div:nth-child(2) {
8787
@apply ml-1 pl-2 border-l-4 border-red-300;
8888
}
8989
}
9090

9191
.symbolSubtitle {
9292
@apply space-y-0.5 text-sm leading-4;
93-
93+
9494
.type {
9595
@apply text-stone-400 italic;
9696
}
9797
}
9898

9999
.docEntry {
100100
@apply text-sm;
101-
101+
102102
.docEntryHeader {
103103
@apply flex justify-between items-start;
104-
104+
105105
> span {
106106
@apply flex items-center break-words gap-2;
107107
}
@@ -116,34 +116,34 @@ summary::-webkit-details-marker {
116116

117117
.namespaceSection {
118118
@apply grid grid-cols-1 lg:grid-cols-3 gap-8;
119-
119+
120120
.namespaceItem {
121121
@apply space-y-2;
122-
122+
123123
&[aria-label="deprecated"] {
124124
@apply opacity-60;
125-
125+
126126
.namespaceItemTitle a {
127127
@apply line-through decoration-2 decoration-stone-500/70 text-stone-500;
128128
}
129129
}
130-
130+
131131
.namespaceItemTitle {
132132
@apply flex gap-2 items-center;
133-
133+
134134
> div:last-child {
135135
@apply flex justify-between gap-4 flex-1 min-w-0 items-end overflow-hidden;
136-
136+
137137
> a {
138138
@apply leading-tight truncate;
139139
}
140-
140+
141141
> div {
142142
@apply text-xs italic lg:mr-4 text-stone-400 truncate;
143143
}
144144
}
145145
}
146-
146+
147147
.namespaceItemContent {
148148
@apply py-1 text-sm leading-5 text-stone-600 markdown_border;
149149
@apply ml-2 !important;
@@ -153,13 +153,13 @@ summary::-webkit-details-marker {
153153

154154
.symbolGroup {
155155
@apply space-y-12;
156-
156+
157157
article {
158158
@apply space-y-5;
159-
159+
160160
> div:first-child {
161161
@apply flex justify-between items-start;
162-
162+
163163
> div:first-child {
164164
@apply font-medium space-y-1;
165165
}
@@ -169,11 +169,11 @@ summary::-webkit-details-marker {
169169

170170
.docNodeKindIcon {
171171
@apply flex justify-end w-[2.125rem] shrink-0;
172-
172+
173173
div {
174174
@apply rounded-full size-5 font-medium text-xs leading-5 text-center align-middle shrink-0 select-none font-mono;
175175
}
176-
176+
177177
> * + * {
178178
@apply -ml-1.5;
179179
}
@@ -182,31 +182,31 @@ summary::-webkit-details-marker {
182182
.example details {
183183
summary {
184184
@apply list-none flex items-center gap-2 py-2 rounded-lg w-full leading-6 cursor-pointer;
185-
185+
186186
> div:first-child {
187187
@apply text-stone-600 select-none;
188188
}
189189
}
190-
190+
191191
&[open] summary > div:first-child {
192192
@apply rotate-90;
193193
}
194194
}
195195

196196
.tocable {
197197
@apply flex max-lg:flex-col-reverse gap-6;
198-
198+
199199
.toc {
200200
@apply flex-none max-w-52 text-sm max-lg:hidden sticky top-0 py-4 max-h-screen box-border;
201-
201+
202202
> ul {
203203
@apply space-y-2 block overflow-y-auto h-full;
204-
204+
205205
ul {
206206
@apply ml-4 space-y-2;
207207
}
208208
}
209-
209+
210210
a {
211211
@apply hover:underline block overflow-x-hidden whitespace-nowrap text-ellipsis;
212212
}
@@ -215,41 +215,41 @@ summary::-webkit-details-marker {
215215

216216
.usage {
217217
@apply px-6 py-5 mb-4 border max-md:border-x-0 md:rounded-lg bg-stone-50 border-stone-200;
218-
218+
219219
nav {
220220
@apply flex items-center flex-row gap-2 mb-3 font-semibold;
221-
221+
222222
details {
223223
> summary {
224224
@apply flex gap-1 select-none cursor-pointer rounded border border-gray-300 py-2 px-3;
225225
}
226-
226+
227227
> div {
228228
@apply md:relative;
229-
229+
230230
> div {
231231
@apply absolute max-md:inset-x-0 mt-1.5 p-2 block z-30 md:w-72 bg-white md:rounded border max-md:border-x-0 border-gray-300;
232-
232+
233233
label {
234234
@apply flex items-center justify-between cursor-pointer select-none px-2 py-1 leading-normal rounded-sm hover:bg-gray-50;
235235
}
236236
}
237237
}
238238
}
239239
}
240-
240+
241241
pre.highlight {
242242
@apply border border-gray-300 max-md:border-x-0;
243243
}
244244
}
245245

246246
.breadcrumbs {
247-
@apply whitespace-nowrap inline-flex gap-1 items-center;
248-
247+
@apply break-all inline-flex gap-1 items-center;
248+
249249
> li, > ul {
250250
@apply py-1 px-2;
251251
}
252-
252+
253253
a {
254254
@apply text-breadcrumb underline decoration-[1.5px] decoration-breadcrumb/50 underline-offset-4 hover:decoration-breadcrumb;
255255
}
@@ -270,11 +270,11 @@ summary::-webkit-details-marker {
270270

271271
.markdown_summary {
272272
@apply inline text-stone-600;
273-
273+
274274
p {
275275
@apply inline-block;
276276
}
277-
277+
278278
:not(pre) > code {
279279
@apply font-mono text-sm py-0.5 px-1 rounded bg-stone-200;
280280
}
@@ -332,7 +332,7 @@ summary::-webkit-details-marker {
332332
:not(pre) > code {
333333
@apply font-mono text-sm py-0.5 px-1 rounded bg-stone-200;
334334
}
335-
335+
336336
h1, h2, h3, h4, h5, h6 {
337337
& > code {
338338
font-size: inherit !important;
@@ -422,7 +422,7 @@ summary::-webkit-details-marker {
422422

423423
.markdown .highlight {
424424
@apply relative;
425-
425+
426426
.lineNumbers {
427427
@apply border-r-2 border-stone-300 pr-1 text-right flex-none;
428428
}

0 commit comments

Comments
 (0)