wrap the code comments when overflow

This commit is contained in:
jasongao97 2022-08-22 16:04:22 -04:00
parent 952b490d0b
commit dd17dc3842
2 changed files with 8 additions and 4 deletions

View file

@ -5,11 +5,11 @@
} }
.pair { .pair {
@apply w-full flex justify-between space-x-8 px-5; @apply w-full px-5 overflow-x-auto;
} }
.pair:not(.no-comment) { .pair:not(.no-comment) {
@apply bg-gray-200 border-l-2 border-noc-400 py-2 my-1; @apply bg-gray-200 border-l-2 border-noc-400 py-2 my-1 flex flex-col-reverse lg:flex-row justify-between flex-wrap-reverse gap-y-2 gap-x-8;
} }
.pair.line-through code { .pair.line-through code {
@ -27,5 +27,9 @@
} }
.comment { .comment {
@apply pl-2 text-sm text-gray-600 max-w-[18em] w-full; @apply text-sm text-gray-600 flex-grow flex lg:justify-end;
}
.comment > p {
@apply lg:w-[18em];
} }

View file

@ -91,7 +91,7 @@ export const rehypeCodesplit = () => (tree) => {
return h('div', { className }, [ return h('div', { className }, [
h('pre', [h('code', { class: ['code', `language-${lang}`] }, codes)]), h('pre', [h('code', { class: ['code', `language-${lang}`] }, codes)]),
h('p', { class: ['comment'] }, comments), h('div', { class: ['comment'] }, h('p', comments)),
]); ]);
}); });