File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,6 +199,10 @@ input[type='search']:focus-visible {
199199 outline : 2px solid color-mix (in oklch, var (--accent ) 70% , transparent);
200200}
201201
202+ /* since we haven't migrated all focus-visible states
203+ we have to keep this otherwise users will get
204+ inconsistent default outlines */
205+ a : focus-visible ,
202206select : focus-visible {
203207 outline : 2px solid var (--accent );
204208 outline-offset : 2px ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ onKeyStroke(
9797 <button
9898 v-if =" !isSearchExpanded && !isOnHomePage"
9999 type =" button"
100- class =" sm:hidden flex-shrink-0 inline-flex items-center gap-2 font-mono text-lg font-medium text-fg hover:text-fg transition-colors duration-200 rounded"
100+ class =" sm:hidden flex-shrink-0 inline-flex items-center gap-2 font-mono text-lg font-medium text-fg hover:text-fg transition-colors duration-200 rounded focus-visible(outline-2 outline-accent) "
101101 :aria-label =" $t('nav.tap_to_search')"
102102 @click =" expandMobileSearch"
103103 >
@@ -111,7 +111,7 @@ onKeyStroke(
111111 :to =" { name: 'index' }"
112112 :aria-label =" $t('header.home')"
113113 dir =" ltr"
114- class =" inline-flex items-center gap-1 header-logo font-mono text-lg font-medium text-fg hover:text-fg/90 transition-colors duration-200 rounded"
114+ class =" inline-flex items-center gap-1 header-logo font-mono text-lg font-medium text-fg hover:text-fg/90 transition-colors duration-200 rounded focus-visible:(outline-2 outline-accent) "
115115 >
116116 <AppLogo class =" w-8 h-8 rounded-lg" />
117117 <span >npmx</span >
Original file line number Diff line number Diff line change @@ -53,8 +53,7 @@ defineExpose({
5353 'text-sm px-4 py-2': size === 'medium',
5454 'text-xs px-2 py-0.5': size === 'small',
5555 'text-fg bg-bg hover:(bg-fg/10 border-fg/10)': variant === 'secondary',
56- 'text-bg bg-fg border-fg hover:(bg-fg/80 rounded-xl) active:rounded-xl':
57- variant === 'primary',
56+ 'text-bg bg-fg border-fg hover:(bg-fg/80)': variant === 'primary',
5857 'opacity-40 cursor-not-allowed border-transparent': disabled,
5958 }"
6059 >
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const props = defineProps<{
77<template >
88 <component
99 :is =" props.as || 'div'"
10- class =" flex [& >*:not(:first -child) ]:rounded-s-none [& >*:not(:first-child)]:border-s-0 [& >*:not(:last-child)]:rounded-e-none "
10+ class =" flex [& >*]:rounded-e-none [ & >*:last -child]:rounded-e-md [ & >*]:rounded- s-none [& >*:first-child]:rounded-s-md [ & >*: not(:first-child)]:border-s-0 [& >*:focus-visible]:relative [ & >*:focus-visible]:z-10 "
1111 >
1212 <slot />
1313 </component >
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ useHead({
8585 <button
8686 :id =" buttonId"
8787 type =" button"
88- class =" w-4 h-4 flex items-center justify-center text-fg-subtle hover:text-fg-muted transition-colors duration-200 shrink-0 focus-visible:outline-accent/70 rounded"
88+ class =" w-4 h-4 flex items-center justify-center text-fg-subtle hover:text-fg-muted transition-colors duration-200 shrink-0 focus-visible:( outline-2 outline-offset-2 outline- accent) rounded"
8989 :aria-expanded =" isOpen"
9090 :aria-controls =" contentId"
9191 :aria-label =" ariaLabel"
Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ defineExpose({ focus })
109109 <div class =" relative group" :class =" { 'is-focused': isSearchFocused }" >
110110 <div class =" search-box relative flex items-center" >
111111 <span
112- class =" absolute inset-is-3 text-fg-subtle font-mono text-sm pointer-events-none transition-colors duration-200 motion-reduce:transition-none [.group:hover:not(:focus-within)_& ]:text-fg/80 group-focus-within:text-accent z-1"
112+ aria-hidden =" true"
113+ class =" absolute inset-is-3 text-fg-subtle font-mono text-sm pointer-events-none transition-colors duration-200 motion-reduce:transition-none group-focus-within:text-accent z-1"
113114 >
114115 /
115116 </span >
@@ -126,7 +127,7 @@ defineExpose({ focus })
126127 @focus =" handleSearchFocus"
127128 @blur =" handleSearchBlur"
128129 />
129- <button type =" submit" class =" sr-only" >{{ $t('search.button') }}</button >
130+ <button type =" submit" class =" sr-only" tabindex = " -1 " >{{ $t('search.button') }}</button >
130131 </div >
131132 </div >
132133 </form >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const hasAnyValidLicense = computed(() => tokens.value.some(t => t.type === 'lic
1818 :href =" token.url"
1919 target =" _blank"
2020 rel =" noopener noreferrer"
21- class =" link-subtle "
21+ class =" focus-visible:(outline-2 outline-accent) rounded-sm "
2222 :title =" $t('package.license.view_spdx')"
2323 >
2424 {{ token.value }}
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ const isButtonMedium = computed(() => props.size === 'medium' && props.variant !
6363 <span
6464 v-if =" disabled"
6565 :class =" {
66- 'opacity-50 inline-flex gap-x-1 items-center justify-center font-mono border rounded-md':
66+ 'opacity-50 inline-flex gap-x-1 items-center justify-center font-mono border border-transparent rounded-md':
6767 isButton,
6868 'text-sm px-4 py-2': isButtonMedium,
6969 'text-xs px-2 py-0.5': isButtonSmall,
@@ -75,14 +75,15 @@ const isButtonMedium = computed(() => props.size === 'medium' && props.variant !
7575 </span >
7676 <NuxtLink
7777 v-else
78- class =" group inline-flex gap-x-1 items-center justify-center rounded-sm outline-transparent active:scale-[0.98] focus-visible:(outline-2 outline-offset-2 outline- accent)"
78+ class =" group inline-flex gap-x-1 items-center justify-center rounded-sm outline-transparent active:scale-[0.98] focus-visible:(outline-2 outline-accent)"
7979 :class =" [
8080 {
8181 'underline-offset-[0.2rem] underline decoration-1 decoration-fg/30':
8282 !isLinkAnchor && isLink,
83- 'font-mono text-fg hover:(decoration-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200':
83+ 'font-mono text-fg hover:(decoration-accent) focus-visible:(decoration-accent outline-offset-2 text-accent) transition-colors duration-200':
8484 isLink,
85- 'border border-solid border-border rounded-md transition-all duration-200': isButton,
85+ 'border border-solid border-border rounded-md transition-all duration-200 focus-visible:outline-offset-2':
86+ isButton,
8687 'text-sm px-4 py-2': isButtonMedium,
8788 'text-xs px-2 py-0.5': isButtonSmall,
8889 'text-fg bg-bg hover:(bg-fg/10 border-fg/10)': variant === 'button-secondary',
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ function handleKeydown(event: KeyboardEvent) {
8888 <button
8989 ref =" triggerRef"
9090 type =" button"
91- class =" flex items-center gap-1.5 px-2 py-2 font-mono text-xs text-fg-muted bg-bg-subtle border border-border-subtle border-solid rounded-md transition-colors duration-150 hover:(text-fg border-border-hover) active:scale-95 focus:border-border-hover focus-visible:outline-accent/70 hover:text-fg"
91+ class =" flex items-center gap-1.5 px-2 py-2 font-mono text-xs text-fg-muted bg-bg-subtle border border-border-subtle border-solid rounded-md transition-colors duration-150 hover:(text-fg border-border-hover) active:scale-95 focus:border-border-hover focus-visible:( outline-2 outline- accent outline-offset-2) hover:text-fg"
9292 :aria-expanded =" isOpen"
9393 aria-haspopup =" listbox"
9494 :aria-label =" $t('package.get_started.pm_label')"
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
324324 <button
325325 v-if =" getTagVersions(row.tag).length > 1 || !hasLoadedAll"
326326 type =" button"
327- class =" w-4 h-4 flex items-center justify-center text-fg-subtle hover:text-fg transition-colors rounded-sm"
327+ class =" w-4 h-4 flex items-center justify-center text-fg-subtle hover:text-fg transition-colors rounded-sm focus-visible:(outline-2 outline-offset-2 outline-accent) "
328328 :aria-expanded =" expandedTags.has(row.tag)"
329329 :aria-label ="
330330 expandedTags.has(row.tag)
@@ -357,7 +357,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
357357 <div >
358358 <LinkBase
359359 :to =" versionRoute(row.primaryVersion.version)"
360- class =" text-sm"
360+ class =" text-sm focus-visible:outline-none "
361361 :class ="
362362 row.primaryVersion.deprecated ? 'text-red-400 hover:text-red-300' : undefined
363363 "
@@ -465,7 +465,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
465465 <div class =" p-1" >
466466 <button
467467 type =" button"
468- class =" flex items-center gap-2 text-start rounded-sm"
468+ class =" flex items-center gap-2 text-start rounded-sm focus-visible:(outline-2 outline-offset-2 outline-accent) "
469469 :aria-expanded =" otherVersionsExpanded"
470470 :aria-label ="
471471 otherVersionsExpanded
You can’t perform that action at this time.
0 commit comments