Skip to content

Commit

Permalink
サブヘッダーのスタイルを改善し、TOCのカスタムスタイルを削除しました。また、ページビュー取得機能を削除し、グローバルCSSにTOCリンク…
Browse files Browse the repository at this point in the history
…のスタイルを追加しました。 (#647)
  • Loading branch information
ttizze authored Feb 28, 2025
2 parents 009a066 + 39613b9 commit 23aae68
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export function SubHeader({
return (
<div ref={headerRef}>
<div
className={`transition-all duration-300 ${
!isVisible ? "-translate-y-full" : "translate-y-0"
} ${isPinned ? "fixed top-0 left-0 right-0 z-50 shadow-md" : ""} bg-background py-4`}
className={`transition-all duration-300 z-[999] ${
!isVisible ? "-translate-y-full" : ""
} ${isPinned ? "fixed top-0 left-0 right-0 shadow-md" : ""} bg-background py-4`}
>
<div
className={`prose dark:prose-invert sm:prose lg:prose-lg mx-auto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ export default function TableOfContents({
scrollSmoothOffset: -70,
});

// Add custom styling for the TOC with a unique ID
const style = document.createElement("style");
style.id = "toc-custom-style";
style.innerHTML = `
.toc-link {
white-space: pre-wrap;
}
`;
document.head.appendChild(style);

// Clean up on unmount
return () => {
tocbot.destroy();
Expand Down
57 changes: 0 additions & 57 deletions next/src/app/[locale]/lib/get-page-views.ts

This file was deleted.

15 changes: 9 additions & 6 deletions next/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,22 @@ body.virtual-keyboard-shown {
margin-top: var(--visual-viewport-offset-top, 0px);
}

.toc-link {
@apply !no-underline;
@apply whitespace-pre-wrap;
}
.toc-link:before {
@apply !hidden;
}

.toc-list {
@apply text-slate-400 !list-none;
}
.toc-link {
@apply !no-underline;
}
.toc-link:hover {
@apply !underline;
}

.toc-list {
@apply text-slate-400;
}

.is-active-link {
@apply !text-primary;
}

0 comments on commit 23aae68

Please sign in to comment.