Skip to content

Commit

Permalink
feat: more accessible styles for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
serhez committed Apr 15, 2024
1 parent 9b2d7d1 commit a8cb419
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ h2 {
}
p {
text-align: justify;
@apply lg:text-justify text-left;
}
</style>
17 changes: 8 additions & 9 deletions components/navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ function isCurrent(href: string) {
<ul class="flex gap-10 text-sm tracking-wide backdrop-blur">
<li v-for="route in routes" :key="route.name">
<nuxt-link :class="[
'relative block transition group hover:before:scale-x-100 hover:before:origin-left before:w-full before:h-0.5 before:origin-right before:transition-transform before:duration-500 before:scale-x-0 before:bg-zinc-800 before:absolute before:left-0 before:bottom-0',
isCurrent(route.href)
? 'relative block transition group before:scale-x-100 hover:before:origin-left before:w-full before:h-0.5 before:origin-right before:transition-transform before:duration-500 before:bg-zinc-800 before:absolute before:left-0 before:bottom-0'
: ''
]" :href="route.href" :aria-label="route.name" :external="route.external" rel="prefetch">
'relative block transition group hover:before:scale-x-100 hover:before:origin-left before:w-full before:h-0.5 before:origin-right before:transition-transform before:duration-500 before:scale-x-0 before:bg-zinc-800 before:absolute before:left-0 before:bottom-0',
isCurrent(route.href)
? 'relative block transition group before:scale-x-100 hover:before:origin-left before:w-full before:h-0.5 before:origin-right before:transition-transform before:duration-500 before:bg-zinc-800 before:absolute before:left-0 before:bottom-0'
: ''
]" :href="route.href" :aria-label="route.name" :external="route.external" rel="prefetch">
<span v-text="route.name" />
</nuxt-link>
</li>
</ul>
</nav>

<popover v-slot="{ open }" class="pointer-events-auto relative md:hidden">
<popover-button
class="group flex items-center px-5 py-2 text-sm font-medium text-zinc-500 focus:outline-none">
<popover-button class="group flex items-center text-md font-medium focus:outline-none">
Menu
<icon name="heroicons-solid:chevron-down" class="ml-2 h-4 w-4 transition duration-300"
:class="{ 'rotate-180': open }" />
Expand Down Expand Up @@ -65,8 +64,8 @@ function isCurrent(href: string) {
<template v-for="route in routes" :key="route.name">
<li v-if="!route.hidden">
<nuxt-link class="block py-2" :href="route.href" :class="{
'text-zinc-200': isCurrent(route.href)
}" :external="route.external" @click="close" v-text="route.name" />
'text-zinc-200': isCurrent(route.href)
}" :external="route.external" @click="close" v-text="route.name" />
</li>
</template>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ useHead({
</script>

<template>
<main class="container mx-auto my-16 flex gap-16 max-w-6xl flex-1 flex-col px-6 sm:px-12">
<main class="container mx-auto my-16 flex md:gap-16 gap-8 max-w-6xl flex-1 flex-col px-8 sm:px-12">
<navigation />
<section class="flex flex-1 flex-col">
<slot />
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ h2 {
}
p {
@apply text-xl text-zinc-700;
@apply text-base sm:text-lg md:text-xl text-zinc-700;
}
</style>

0 comments on commit a8cb419

Please sign in to comment.