From ffe28e9e1282864519256229144816b6e2641b38 Mon Sep 17 00:00:00 2001 From: Drew Powers Date: Fri, 8 Mar 2024 10:20:23 -0700 Subject: [PATCH] Fix leaky styles --- packages/nextra-theme-docs/css/styles.css | 17 ++++++++--------- .../src/components/back-to-top.tsx | 2 +- .../nextra-theme-docs/src/components/banner.tsx | 2 +- .../nextra-theme-docs/src/components/footer.tsx | 2 +- .../nextra-theme-docs/src/components/navbar.tsx | 6 +++--- .../nextra-theme-docs/src/components/select.tsx | 2 +- .../src/components/sidebar.tsx | 4 ++-- .../nextra-theme-docs/src/components/toc.tsx | 2 +- .../nextra-theme-docs/src/mdx-components.tsx | 6 +++--- 9 files changed, 21 insertions(+), 22 deletions(-) diff --git a/packages/nextra-theme-docs/css/styles.css b/packages/nextra-theme-docs/css/styles.css index 1422294967..77ec1f549b 100644 --- a/packages/nextra-theme-docs/css/styles.css +++ b/packages/nextra-theme-docs/css/styles.css @@ -22,19 +22,18 @@ body { @apply _w-full dark:_text-gray-100; } -a, -summary, -button, -input, -[tabindex]:not([tabindex='-1']) { +.nextra-focusable, +.nextra-landmark a, +.nextra-landmark button, +.nextra-landmark input { + @apply _outline-none; &:focus-visible { @apply _outline-none; @apply _ring-2 _ring-primary-200 _ring-offset-1 _ring-offset-primary-300 dark:_ring-primary-800 dark:_ring-offset-primary-700; } } -a, -summary { +.nextra-landmark a { @apply _rounded; } @@ -82,7 +81,7 @@ summary { } @media (prefers-reduced-motion: reduce) and (max-width: 767px) { - article:before, + article::before, .nextra-sidebar-container, .nextra-sidebar-container.open, body.resizing .nextra-sidebar-container { @@ -91,7 +90,7 @@ summary { } /* Content Typography */ -summary::-webkit-details-marker { +.nextra-summary::-webkit-details-marker { @apply _hidden; } diff --git a/packages/nextra-theme-docs/src/components/back-to-top.tsx b/packages/nextra-theme-docs/src/components/back-to-top.tsx index 00789f657d..09a00bb103 100644 --- a/packages/nextra-theme-docs/src/components/back-to-top.tsx +++ b/packages/nextra-theme-docs/src/components/back-to-top.tsx @@ -19,7 +19,7 @@ export function BackToTop({ onClick={scrollToTop} disabled={hidden} className={cn( - '_flex _items-center _gap-1.5 _transition _opacity-100 disabled:_opacity-0', + '_flex _items-center _gap-1.5 _transition _opacity-100 disabled:_opacity-0 nextra-focusable', className )} > diff --git a/packages/nextra-theme-docs/src/components/banner.tsx b/packages/nextra-theme-docs/src/components/banner.tsx index 814b515020..a161f21426 100644 --- a/packages/nextra-theme-docs/src/components/banner.tsx +++ b/packages/nextra-theme-docs/src/components/banner.tsx @@ -31,7 +31,7 @@ export function Banner(): ReactElement | null {