style: try implementing nowrap and ellipsis

This commit is contained in:
TAKAHASHI Shuuji 2025-01-04 16:43:02 +09:00
parent 80dfd37bdc
commit 94e2f65de6
13 changed files with 29 additions and 26 deletions

View file

@ -13,12 +13,12 @@ const hideLabel = useHideBottomNavigationLabel()
to="/bookmarks" to="/bookmarks"
:aria-label="$t('nav.bookmarks')" :aria-label="$t('nav.bookmarks')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:bookmark-line /> <div aria-hidden="true" i-ri:bookmark-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.bookmarks') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.bookmarks') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -11,12 +11,12 @@ const hideLabel = useHideBottomNavigationLabel()
to="/compose" to="/compose"
:aria-label="$t('nav.favourites')" :aria-label="$t('nav.favourites')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:quill-pen-line /> <div aria-hidden="true" i-ri:quill-pen-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.favourites') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.favourites') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -16,11 +16,12 @@ const hideLabel = computed(() => getPreferences(userSettings.value, 'hideBottomN
:to="`/${currentServer}/explore/${lastAccessedExploreRoute}`" :to="`/${currentServer}/explore/${lastAccessedExploreRoute}`"
:aria-label="$t('nav.explore')" :aria-label="$t('nav.explore')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:compass-3-line /> <div aria-hidden="true" i-ri:compass-3-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.explore') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.explore') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -11,12 +11,12 @@ const hideLabel = useHideBottomNavigationLabel()
to="/favourites" to="/favourites"
:aria-label="$t('nav.favourites')" :aria-label="$t('nav.favourites')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:heart-line /> <div aria-hidden="true" i-ri:heart-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.favourites') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.favourites') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -13,12 +13,12 @@ const hideLabel = useHideBottomNavigationLabel()
:to="`/${currentServer}/public`" :to="`/${currentServer}/public`"
:aria-label="$t('nav.federated')" :aria-label="$t('nav.federated')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:earth-line /> <div aria-hidden="true" i-ri:earth-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.federated') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.federated') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -11,12 +11,12 @@ const hideLabel = useHideBottomNavigationLabel()
to="/hashtags" to="/hashtags"
:aria-label="$t('nav.hashtags')" :aria-label="$t('nav.hashtags')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:hashtag /> <div aria-hidden="true" i-ri:hashtag />
<span v-if="!hideLabel" text-xs>{{ $t('nav.hashtags') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.hashtags') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -11,12 +11,12 @@ const hideLabel = useHideBottomNavigationLabel()
to="/home" to="/home"
:aria-label="$t('nav.home')" :aria-label="$t('nav.home')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:home-5-line /> <div aria-hidden="true" i-ri:home-5-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.home') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.home') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -13,12 +13,12 @@ const hideLabel = useHideBottomNavigationLabel()
to="/lists" to="/lists"
:aria-label="$t('nav.lists')" :aria-label="$t('nav.lists')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:list-check /> <div aria-hidden="true" i-ri:list-check />
<span v-if="!hideLabel" text-xs>{{ $t('nav.lists') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.lists') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -11,12 +11,12 @@ const hideLabel = useHideBottomNavigationLabel()
group group
:to="`/${currentServer}/public/local`" :to="`/${currentServer}/public/local`"
:aria-label="$t('nav.local')" :active-class="activeClass" :aria-label="$t('nav.local')" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:group-2-line /> <div aria-hidden="true" i-ri:group-2-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.local') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.local') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -11,12 +11,14 @@ const hideLabel = useHideBottomNavigationLabel()
to="/conversations" to="/conversations"
:aria-label="$t('nav.conversations')" :aria-label="$t('nav.conversations')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:at-line /> <div aria-hidden="true" i-ri:at-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.conversations') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>
{{ $t('nav.conversations') }}
</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -10,14 +10,14 @@ const hideLabel = useHideBottomNavigationLabel()
place-content-center h-full flex-1 cursor-pointer place-content-center h-full flex-1 cursor-pointer
> >
<button <button
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="select-none" class="select-none"
:class="[show ? '!text-primary' : null, hideLabel ? null : 'gap-1'].filter(Boolean).join(' ')" :class="[show ? '!text-primary' : null, hideLabel ? null : 'gap-1'].filter(Boolean).join(' ')"
:aria-label="$t('nav.more_menu')" :aria-label="$t('nav.more_menu')"
@click="toggleVisible" @click="toggleVisible"
> >
<span :class="show ? 'i-ri:close-fill' : 'i-ri:more-fill'" /> <span :class="show ? 'i-ri:close-fill' : 'i-ri:more-fill'" />
<span v-if="!hideLabel" text-xs>{{ $t('nav.more_menu') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.more_menu') }}</span>
</button> </button>
</NavBottomMoreMenu> </NavBottomMoreMenu>
</template> </template>

View file

@ -16,7 +16,7 @@ const hideLabel = useHideBottomNavigationLabel()
:to="`/notifications/${lastAccessedNotificationRoute}`" :to="`/notifications/${lastAccessedNotificationRoute}`"
:aria-label="$t('nav.notifications')" :aria-label="$t('nav.notifications')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
@ -27,6 +27,6 @@ const hideLabel = useHideBottomNavigationLabel()
{{ notifications < 10 ? notifications : '•' }} {{ notifications < 10 ? notifications : '•' }}
</div> </div>
</div> </div>
<span v-if="!hideLabel" text-xs>{{ $t('nav.notifications') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.notifications') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>

View file

@ -11,12 +11,12 @@ const hideLabel = useHideBottomNavigationLabel()
to="/search" to="/search"
:aria-label="$t('nav.search')" :aria-label="$t('nav.search')"
:active-class="activeClass" :active-class="activeClass"
flex flex-col items-center place-content-center h-full flex-1 flex flex-col items-center place-content-center h-full flex-1 min-w-0
class="coarse-pointer:select-none" class="coarse-pointer:select-none"
:class="hideLabel ? null : 'gap-1'" :class="hideLabel ? null : 'gap-1'"
@click="$scrollToTop" @click="$scrollToTop"
> >
<div aria-hidden="true" i-ri:search-line /> <div aria-hidden="true" i-ri:search-line />
<span v-if="!hideLabel" text-xs>{{ $t('nav.search') }}</span> <span v-if="!hideLabel" text-xs overflow-hidden text-ellipsis whitespace-nowrap>{{ $t('nav.search') }}</span>
</NuxtLink> </NuxtLink>
</template> </template>