allow collection card names to wrap to 2 lines

This commit is contained in:
Justin Edmund 2025-12-19 12:26:55 -08:00
parent 2f89a9a880
commit 7608b189fa
4 changed files with 33 additions and 4 deletions

View file

@ -125,13 +125,19 @@
} }
.artifact-name { .artifact-name {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: $font-small; font-size: $font-small;
line-height: 1.4;
color: var(--text-tertiary); color: var(--text-tertiary);
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: normal;
word-break: break-word;
max-width: 139px; max-width: 139px;
min-height: calc($font-small * 1.4 * 2);
&.nickname { &.nickname {
font-weight: $bold; font-weight: $bold;

View file

@ -2,6 +2,7 @@
import type { CollectionCharacter } from '$lib/types/api/collection' import type { CollectionCharacter } from '$lib/types/api/collection'
import { getCharacterImageWithPose } from '$lib/utils/images' import { getCharacterImageWithPose } from '$lib/utils/images'
import UncapIndicator from '$lib/components/uncap/UncapIndicator.svelte' import UncapIndicator from '$lib/components/uncap/UncapIndicator.svelte'
import CharacterTags from '$lib/components/tags/CharacterTags.svelte'
import perpetuityFilled from '$src/assets/icons/perpetuity/filled.svg' import perpetuityFilled from '$src/assets/icons/perpetuity/filled.svg'
interface Props { interface Props {
@ -50,6 +51,9 @@
transcendence={!character.character?.special && character.character?.uncap?.ulb} transcendence={!character.character?.special && character.character?.uncap?.ulb}
/> />
<span class="character-name">{displayName}</span> <span class="character-name">{displayName}</span>
{#if character.character}
<CharacterTags character={character.character} />
{/if}
</button> </button>
<style lang="scss"> <style lang="scss">
@ -61,6 +65,7 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: $unit-half; gap: $unit-half;
width: 100%;
padding: 0; padding: 0;
border: none; border: none;
background: transparent; background: transparent;
@ -104,12 +109,18 @@
} }
.character-name { .character-name {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: typography.$font-small; font-size: typography.$font-small;
line-height: 1.4;
color: var(--text-tertiary); color: var(--text-tertiary);
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: normal;
word-break: break-word;
max-width: 100%; max-width: 100%;
max-height: calc(typography.$font-small * 1.4 * 2);
} }
</style> </style>

View file

@ -80,12 +80,18 @@
} }
.summon-name { .summon-name {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: typography.$font-small; font-size: typography.$font-small;
line-height: 1.4;
color: var(--text-tertiary); color: var(--text-tertiary);
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: normal;
word-break: break-word;
max-width: 100%; max-width: 100%;
min-height: calc(typography.$font-small * 1.4 * 2);
} }
</style> </style>

View file

@ -106,12 +106,18 @@
} }
.weapon-name { .weapon-name {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: typography.$font-small; font-size: typography.$font-small;
line-height: 1.4;
color: var(--text-tertiary); color: var(--text-tertiary);
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: normal;
word-break: break-word;
max-width: 100%; max-width: 100%;
min-height: calc(typography.$font-small * 1.4 * 2);
} }
</style> </style>