Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

サブヘッダーのスタイルを改善し、TOCのカスタムスタイルを削除しました。また、ページビュー取得機能を削除し、グローバルCSSにTOCリンクのスタイルを追加しました。 #647

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}