Skip to content

Commit

Permalink
Merge pull request #493 from shuding/jp/fix/nav-and-layout
Browse files Browse the repository at this point in the history
Fix navbar newWindow styles and raw layout centering
  • Loading branch information
shuding authored Jun 23, 2022
2 parents 31a586c + 410b3f6 commit 3dc74bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/nextra-theme-docs/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ const Content: React.FC<LayoutProps> = ({
{activeType === 'page' ||
hideToc ||
themeContext.layout !== 'default' ? (
themeContext.layout === 'full' ? null : (
themeContext.layout === 'full' ||
themeContext.layout === 'raw' ? null : (
<div className="nextra-toc w-64 hidden xl:block text-sm px-4 order-last flex-shrink-0" />
)
) : (
Expand Down
12 changes: 8 additions & 4 deletions packages/nextra-theme-docs/src/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,17 @@ export default function Navbar({ flatDirectories, items }: NavBarProps) {
className={cn(
'nextra-nav-link',
'no-underline whitespace-nowrap p-2 -ml-2 hidden md:inline-block',
isActive
? 'active text-current font-medium'
: 'text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200'
!isActive || page.newWindow
? 'text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200'
: 'active text-current font-medium'
)}
aria-selected={isActive}
{...(page.newWindow
? { target: '_blank', rel: 'noopener noreferrer' }
? {
target: '_blank',
rel: 'noopener noreferrer',
'aria-selected': false
}
: {})}
>
{page.title}
Expand Down

0 comments on commit 3dc74bd

Please sign in to comment.