mirror of
https://github.com/nature-of-code/noc-book-2
synced 2024-11-17 07:49:05 +01:00
wrap the code comments when overflow
This commit is contained in:
parent
952b490d0b
commit
dd17dc3842
2 changed files with 8 additions and 4 deletions
|
@ -5,11 +5,11 @@
|
|||
}
|
||||
|
||||
.pair {
|
||||
@apply w-full flex justify-between space-x-8 px-5;
|
||||
@apply w-full px-5 overflow-x-auto;
|
||||
}
|
||||
|
||||
.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 {
|
||||
|
@ -27,5 +27,9 @@
|
|||
}
|
||||
|
||||
.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];
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ export const rehypeCodesplit = () => (tree) => {
|
|||
|
||||
return h('div', { className }, [
|
||||
h('pre', [h('code', { class: ['code', `language-${lang}`] }, codes)]),
|
||||
h('p', { class: ['comment'] }, comments),
|
||||
h('div', { class: ['comment'] }, h('p', comments)),
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue