Skip to content

Commit

Permalink
fix: Overflow wrap anywhere (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhuh authored May 31, 2022
1 parent 3db6900 commit 112e6ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/profile/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Card = (props: { user: GuildedUser; bio: string | null }) => {
<hr className="mb-2 mt-4 border-guilded-gray border" />
<div className="flex shadow-inner">
{props.bio ? (
<p className="w-full max-h-20 text-guilded-white text-left whitespace-pre-wrap linear-gradient">
<p className="w-full max-h-20 text-guilded-white text-left whitespace-pre-wrap overflow-wrap-anywhere linear-gradient">
{props.bio.length > 150 ? props.bio.slice(0, 150) + "..." : props.bio}
</p>
) : (
Expand Down
2 changes: 1 addition & 1 deletion pages/users/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const UserPage: NextPage<Props> = ({ user, bio }) => {
<div className="flex">
<div className="flex w-full max-h-48 overflow-y-auto overflow-x-hidden">
{bio?.content ? (
<p className="text-clip whitespace-pre-wrap">{bioContent}</p>
<p className="text-clip whitespace-pre-wrap overflow-wrap-anywhere">{bioContent}</p>
) : (
<p className="italic text-guilded-subtitle break-all">
No content yet, but we&apos;re sure they&apos;re an amazing person!
Expand Down
4 changes: 4 additions & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ body::-webkit-scrollbar {
mask-image: linear-gradient(black 55%, transparent 100%);
}

.overflow-wrap-anywhere {
overflow-wrap: anywhere;
}

/* width */
::-webkit-scrollbar {
width: 5px;
Expand Down

1 comment on commit 112e6ca

@vercel
Copy link

@vercel vercel bot commented on 112e6ca May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.