Skip to content

Commit

Permalink
chore: style table
Browse files Browse the repository at this point in the history
  • Loading branch information
jer3m01 committed Oct 17, 2024
1 parent 4e7c882 commit 6a5c013
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/client/components/Article.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
max-height: calc(100dvh - var(--header-height) - 4rem + var(--header-offset));
right: 0;
transition: transform .3s ease-in-out;
overflow-y: auto;
}

@media screen and (max-width: 1300px) {
Expand Down
5 changes: 4 additions & 1 deletion src/client/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ const Navigation = (props: NavigationProps) => {
<For each={section.items}>
{(item) => (
<li>
<a class={styles["sidenav-link"]} href={item.link}>
<a
class={styles["sidenav-link"]}
href={(item as { link: string }).link}
>
{item.title}
</a>
</li>
Expand Down
38 changes: 38 additions & 0 deletions src/client/components/mdx-components.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,41 @@ a[data-footnote-ref] {
color: var(--danger-text-color);
}
}

.table {
overflow-x: auto;

& > table {
width: 100%;
table-layout: auto;
text-align: left;
margin-top: 2em;
margin-bottom: 2em;
font-size: .875em;
line-height: 1.7;

& > thead {
color: var(--heading-color);
font-family: var(--font-headings);
border-bottom: 1px solid var(--decoration-color);
}

& tr {
color: var(--text-color);
border-bottom: 1px solid
color-mix(in hsl, var(--decoration-color) 20%, transparent);

& > * {
padding: .5rem;

&:first-child {
padding-left: 0;
}

&:last-child {
padding-right: 0;
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/client/components/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export function table(props: ComponentProps<"table">) {
const [local, others] = splitProps(props, ["class"]);

return (
<div style={{ "overflow-x": "auto" }}>
<table class="" {...others} />
<div class={styles.table}>
<table {...others} />
</div>
);
}
Expand Down

0 comments on commit 6a5c013

Please sign in to comment.