fix(ui): burger section sheet at phone width, 36px control scale
The coarse-pointer rule gave every button, link and field a 44px minimum on touch, which made the phone dashboard look like a toy and pushed the section strip into overlapping its neighbours. Controls now keep their own size, and the shared ladder is one step taller (default 36px, sm 32px) so a finger still hits something. Inputs stay 16px only where iOS would zoom. Below md the sections move into a sheet with the current page marked; the bar keeps brand, search, alerts and the operator. Page titles drop to 18px so the title and its action sit on one centred line.
This commit is contained in:
1 parent
0d4b83862c
commit
8ea5ad6faf
16 files changed
+88
-49
No files matched your search
@@ -5,7 +5,7 @@ defineProps<{ title: string }>();
|
||||
|
||||
<template>
|
||||
<header class="mb-4 flex min-h-9 flex-wrap items-center justify-between gap-x-4 gap-y-2">
|
||||
<h1 class="text-xl font-semibold tracking-tight">{{ title }}</h1>
|
||||
<h1 class="text-lg leading-tight font-semibold tracking-tight sm:text-xl sm:leading-7">{{ title }}</h1>
|
||||
<div v-if="$slots.default" class="flex flex-wrap items-center gap-2">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, watch } from "vue";
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import { activeNavPath, navTree, type NavEntry } from "@/lib/nav";
|
||||
@@ -7,6 +7,7 @@ import { activeNavPath, navTree, type NavEntry } from "@/lib/nav";
|
||||
const props = defineProps<{ hidden: string[] }>();
|
||||
|
||||
const route = useRoute();
|
||||
const root = ref<HTMLElement | null>(null);
|
||||
const links = computed(() =>
|
||||
navTree(props.hidden).flatMap((node): NavEntry[] => (node.kind === "link" ? [node.entry] : [])),
|
||||
);
|
||||
@@ -16,8 +17,8 @@ const activePath = computed(() => activeNavPath(route.path));
|
||||
// outside it. Centre it after each route change; block:"nearest" keeps it from
|
||||
// scrolling the page too.
|
||||
function revealActive(): void {
|
||||
document
|
||||
.querySelector('nav[aria-label="Sections"] [aria-current="page"]')
|
||||
root.value
|
||||
?.querySelector('[aria-current="page"]')
|
||||
?.scrollIntoView({ inline: "center", block: "nearest" });
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ watch(activePath, revealActive, { flush: "post" });
|
||||
|
||||
<template>
|
||||
<nav
|
||||
ref="root"
|
||||
aria-label="Sections"
|
||||
class="flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]"
|
||||
>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { Menu } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
|
||||
import { activeNavPath, navTree, type NavEntry } from "@/lib/nav";
|
||||
|
||||
/** The section list at phone width, where the strip has no room to show a
|
||||
* label beside the current page. Sheet rather than a dropdown: it traps focus,
|
||||
* takes the full height of a short screen, and holds rows a finger can hit. */
|
||||
const props = defineProps<{ hidden: string[] }>();
|
||||
|
||||
const route = useRoute();
|
||||
const open = ref(false);
|
||||
const links = computed(() =>
|
||||
navTree(props.hidden).flatMap((node): NavEntry[] => (node.kind === "link" ? [node.entry] : [])),
|
||||
);
|
||||
const activePath = computed(() => activeNavPath(route.path));
|
||||
|
||||
watch(() => route.path, () => (open.value = false));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Sheet v-model:open="open">
|
||||
<SheetTrigger as-child>
|
||||
<Button variant="ghost" size="icon" aria-label="Sections">
|
||||
<Menu aria-hidden="true" />
|
||||
</Button>
|
||||
</SheetTrigger>
|
||||
<SheetContent side="left" class="w-64 gap-0 p-0">
|
||||
<SheetHeader class="border-b px-4 py-3">
|
||||
<SheetTitle class="text-sm">Sections</SheetTitle>
|
||||
</SheetHeader>
|
||||
<nav aria-label="Sections" class="flex flex-col gap-0.5 p-2">
|
||||
<RouterLink
|
||||
v-for="entry in links"
|
||||
:key="entry.path"
|
||||
:to="entry.path"
|
||||
:aria-current="activePath === entry.path ? 'page' : undefined"
|
||||
:data-current="activePath === entry.path ? '' : undefined"
|
||||
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 flex h-11 items-center rounded-md px-3 text-sm font-medium transition-colors outline-none focus-visible:ring-[3px]"
|
||||
>{{ entry.label }}</RouterLink
|
||||
>
|
||||
</nav>
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
</template>
|
||||
@@ -6,6 +6,7 @@ import NewTaskDialog from "@/tasks/NewTaskDialog.vue";
|
||||
import Brand from "./Brand.vue";
|
||||
import ConnectionPill from "./ConnectionPill.vue";
|
||||
import Nav from "./Nav.vue";
|
||||
import NavMenu from "./NavMenu.vue";
|
||||
import ProfileDropdown from "./ProfileDropdown.vue";
|
||||
|
||||
const props = defineProps<{ hidden: string[] }>();
|
||||
@@ -16,9 +17,13 @@ const newTaskOpen = ref(false);
|
||||
<header
|
||||
class="bg-background/80 sticky top-0 z-40 flex h-14 items-center gap-3 border-b px-3 backdrop-blur-xl sm:px-4"
|
||||
>
|
||||
<div class="md:hidden"><NavMenu :hidden="props.hidden" /></div>
|
||||
<Brand />
|
||||
<Nav :hidden="props.hidden" />
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
<!-- Below md the strip cannot show a label beside the current page, so the
|
||||
sheet carries the sections and the bar keeps brand, search, alerts and
|
||||
the operator. -->
|
||||
<div class="min-w-0 flex-1 max-md:hidden"><Nav :hidden="props.hidden" /></div>
|
||||
<div class="ml-auto flex shrink-0 items-center gap-2">
|
||||
<ConnectionPill />
|
||||
<CommandPalette :hidden="props.hidden" @new-task="newTaskOpen = true" />
|
||||
<NewTaskDialog v-if="!props.hidden.includes('/workflows')" v-model:open="newTaskOpen" />
|
||||
|
||||
@@ -26,16 +26,16 @@ export const buttonVariants = cva(
|
||||
},
|
||||
size: {
|
||||
default:
|
||||
"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*=size-])]:size-3",
|
||||
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*=size-])]:size-3.5",
|
||||
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
icon: "size-8",
|
||||
sm: "h-8 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*=size-])]:size-3.5",
|
||||
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
icon: "size-9",
|
||||
"icon-xs":
|
||||
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*=size-])]:size-3",
|
||||
"icon-sm":
|
||||
"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
||||
"icon-lg": "size-9",
|
||||
"size-8 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
||||
"icon-lg": "size-10",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
|
||||
@@ -29,7 +29,7 @@ const { filterState } = useCommand()
|
||||
data-slot="command-input-wrapper"
|
||||
class="p-1 pb-0"
|
||||
>
|
||||
<InputGroup class="bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!">
|
||||
<InputGroup class="bg-input/30 border-input/30 h-9! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!">
|
||||
<ListboxFilter
|
||||
v-bind="{ ...forwardedProps, ...$attrs }"
|
||||
v-model="filterState.search"
|
||||
|
||||
@@ -13,7 +13,7 @@ const props = defineProps<{
|
||||
role="group"
|
||||
:class="
|
||||
cn(
|
||||
'border-input bg-card dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-lg border transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto',
|
||||
'border-input bg-card dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-9 rounded-lg border transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
|
||||
@@ -25,7 +25,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
|
||||
data-slot="input"
|
||||
:class="
|
||||
cn(
|
||||
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-card px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-fg-muted disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
||||
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-9 rounded-lg border bg-card px-2.5 py-1 text-sm transition-colors pointer-coarse:text-base file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-fg-muted disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
|
||||
@@ -38,7 +38,7 @@ const delegatedProps = reactiveOmit(props, 'class', 'size')
|
||||
v-bind="{ ...$attrs, ...delegatedProps }"
|
||||
v-model="modelValue"
|
||||
data-slot="native-select"
|
||||
class="border-input placeholder:text-fg-muted selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-card py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
|
||||
class="border-input placeholder:text-fg-muted selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 w-full min-w-0 appearance-none rounded-lg border bg-card py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-8 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
|
||||
:data-size="props.size ?? 'default'"
|
||||
>
|
||||
<slot />
|
||||
|
||||
@@ -12,7 +12,7 @@ const props = defineProps<{
|
||||
<NumberFieldInput
|
||||
data-slot="input"
|
||||
:class="cn(
|
||||
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-card px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 text-center outline-none placeholder:text-fg-muted disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
||||
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-9 rounded-lg border bg-card px-2.5 py-1 text-sm transition-colors pointer-coarse:text-base file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 w-full min-w-0 text-center outline-none placeholder:text-fg-muted disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
||||
props.class,
|
||||
)"
|
||||
/>
|
||||
|
||||
@@ -19,12 +19,12 @@ defineEmits<{ change: [] }>();
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<div class="flex h-8 items-center gap-2 rounded-lg border border-input bg-card px-2.5 font-mono text-[13px]">
|
||||
<div class="flex h-9 items-center gap-2 rounded-lg border border-input bg-card px-2.5 font-mono text-[13px]">
|
||||
<Lock class="size-3.5 shrink-0 text-fg-muted" aria-hidden="true" />
|
||||
<span class="text-fg-muted">{{ engine }}</span>
|
||||
<span class="text-fg-muted" aria-hidden="true">/</span>
|
||||
<span class="min-w-0 flex-1 truncate">{{ secretKey }}</span>
|
||||
<Button variant="ghost" size="sm" class="h-7" :disabled="disabled" @click="$emit('change')">Change</Button>
|
||||
<Button variant="ghost" size="sm" class="h-8" :disabled="disabled" @click="$emit('change')">Change</Button>
|
||||
</div>
|
||||
<p v-if="resolved === true" class="flex items-center gap-1.5 text-xs text-ok">
|
||||
<CircleCheck class="size-3.5" aria-hidden="true" /> Secret available</p>
|
||||
|
||||
@@ -28,7 +28,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
||||
v-bind="forwardedProps"
|
||||
:class="
|
||||
cn(
|
||||
'border-input data-placeholder:text-fg-muted dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-card py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=size-])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
||||
'border-input data-placeholder:text-fg-muted dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-card py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=size-])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
|
||||
@@ -7,7 +7,7 @@ export { default as TabsList } from "./TabsList.vue";
|
||||
export { default as TabsTrigger } from "./TabsTrigger.vue";
|
||||
|
||||
export const tabsListVariants = cva(
|
||||
"rounded-lg p-0.75 group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list inline-flex w-fit items-center justify-center text-muted-foreground group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",
|
||||
"rounded-lg p-0.75 group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list inline-flex w-fit items-center justify-center text-muted-foreground group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
|
||||
@@ -25,7 +25,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
|
||||
data-slot="textarea"
|
||||
:class="
|
||||
cn(
|
||||
'border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-card px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm flex field-sizing-content min-h-16 w-full outline-none placeholder:text-fg-muted disabled:cursor-not-allowed disabled:opacity-50',
|
||||
'border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-card px-2.5 py-2 text-sm transition-colors pointer-coarse:text-base focus-visible:ring-3 aria-invalid:ring-3 flex field-sizing-content min-h-16 w-full outline-none placeholder:text-fg-muted disabled:cursor-not-allowed disabled:opacity-50',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
|
||||
@@ -13,9 +13,9 @@ export const toggleVariants = cva(
|
||||
},
|
||||
size: {
|
||||
default:
|
||||
"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*=size-])]:size-3.5",
|
||||
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
sm: "h-8 min-w-8 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*=size-])]:size-3.5",
|
||||
lg: "h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
|
||||
+7
-24
@@ -254,31 +254,14 @@
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
/* Fingers need 44px targets (WCAG 2.5.5). Min sizes rather than heights, so
|
||||
a component's own sizing still applies wherever it is already larger,
|
||||
and inline links in prose are unaffected because min sizes do not apply
|
||||
to inline boxes. Only a coarse pointer means a finger: a narrow window on
|
||||
a desktop still uses a mouse. Switches and tab triggers are exempt because
|
||||
they shrink their own box (a switch draws its hit area with ::after, tabs
|
||||
share a fixed-height strip), so a min size deforms them instead. */
|
||||
/* Rows in a floating menu are the one thing a finger cannot aim at with a
|
||||
mouse's precision, and a min height there cannot deform a layout because
|
||||
the panel is sized by its content. Everything else keeps its own size:
|
||||
min sizes on buttons, links and fields made every control on a phone 44px
|
||||
tall and 44px wide, which is what made the dashboard look like a toy. */
|
||||
@media (pointer: coarse) {
|
||||
:where(
|
||||
button:not([role="switch"], [role="tab"]),
|
||||
a[href],
|
||||
summary,
|
||||
select,
|
||||
textarea,
|
||||
input:not([type="checkbox"], [type="radio"], [type="hidden"]),
|
||||
[role="button"],
|
||||
[role="menuitem"],
|
||||
[role="option"]
|
||||
) {
|
||||
min-height: 44px;
|
||||
min-width: 44px;
|
||||
}
|
||||
/* Tabs fill their list, so the list carries the touch height instead. */
|
||||
[data-slot="tabs-list"] {
|
||||
min-height: 44px;
|
||||
:where([role="menuitem"], [role="option"]) {
|
||||
min-height: 2.75rem;
|
||||
}
|
||||
}
|
||||
/* An accessibility invariant, not a nicety: nothing animates for someone
|
||||
|
||||
Reference in new issue
Block a user