Skip to content

Commit ca51306

Browse files
87xiedimaMachina
andauthoredSep 26, 2024··
[v3] enhance focus ring style consistency (#3286)
* [v3] enhance focus ring style consistency * Update tabs.tsx Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com> * fix focus param missing * Update packages/nextra-theme-docs/css/styles.css Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com> --------- Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
1 parent 1e2a159 commit ca51306

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
 

‎.changeset/shiny-dolphins-walk.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'nextra-theme-docs': patch
3+
'nextra': patch
4+
---
5+
6+
Enhance focus ring style consistency.

‎packages/nextra-theme-docs/src/components/skip-nav.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const SkipNavLink = forwardRef<HTMLAnchorElement, SkipNavLinkProps>(
5757
? styled // Give the user a way to opt-in the default style provided with the theme. Probably remove this option in the next major version (v3.x) and just do a check to use the providedClassName or the default
5858
? cn(
5959
'_sr-only',
60+
'nextra-focus',
6061
'focus:_not-sr-only focus:_fixed focus:_z-50 focus:_m-3 focus:_ml-4 focus:_h-[calc(var(--nextra-navbar-height)-1.5rem)] focus:_rounded-lg focus:_border focus:_px-3 focus:_py-2 focus:_align-middle focus:_text-sm focus:_font-bold',
6162
'focus:_text-gray-900 focus:dark:_text-gray-100',
6263
'focus:_bg-white focus:dark:_bg-neutral-900',

‎packages/nextra/src/client/components/tabs/tabs.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export function Tabs({
104104
className={({ selected, disabled, hover, focus }) =>
105105
cn(
106106
focus && 'nextra-focusable _ring-inset',
107+
selected && '_outline-none',
107108
'_whitespace-nowrap',
108109
'_rounded-t _p-2 _font-medium _leading-5 _transition-colors',
109110
'_-mb-0.5 _select-none _border-b-2',

0 commit comments

Comments
 (0)
Please sign in to comment.