Skip to content

Commit

Permalink
table 태그를 overflow-x:auto 로 감싸도록 수정(UI 깨짐 수정)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddochea0314 committed Jul 11, 2023
1 parent 3c888d2 commit f2d9337
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 6 deletions.
244 changes: 243 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"hastscript": "^7.2.0",
"mdsvex": "^0.10.6",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0"
"rehype-slug": "^5.1.0",
"rehype-wrap-all": "^1.1.0"
}
}
3 changes: 3 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
main {
min-height: 50vh;
}
overflow-x-auto {
@apply overflow-x-auto; /* .md에서만 사용할 때도 적용되도록 css파일에서 호출 처리 */
}
}
@tailwind components;
@tailwind utilities;
Expand Down
11 changes: 7 additions & 4 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { mdsvex } from 'mdsvex';
// Rehype plugins : https://github.com/rehypejs/rehype/blob/HEAD/doc/plugins.md#list-of-plugins
import rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeWrapAll from 'rehype-wrap-all';
// import { h } from 'hastscript';

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -20,8 +21,7 @@ const config = {
extensions: ['.svx', '.md'],
rehypePlugins: [
[rehypeSlug],
[
rehypeAutolinkHeadings,
[rehypeAutolinkHeadings,
{
behavior: 'append',
properties: {
Expand All @@ -39,8 +39,11 @@ const config = {
// console.log(node);
// return h('span', { class: 'relative' }, '🔗')
// }
}
]
}],
[rehypeWrapAll, {
selector: 'table',
wrapper: 'div.overflow-x-auto'
}]
]
})
],
Expand Down

0 comments on commit f2d9337

Please sign in to comment.