Skip to content

Commit 218e1be

Browse files
committed
tweak blog styles for mobile
1 parent 55b6f3f commit 218e1be

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

app/routes/_extras.blog.$slug.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useRef } from "react";
44
import { useDelegatedReactRouterLinks } from "~/ui/delegate-links";
55

66
import { Subscribe } from "~/ui/subscribe";
7-
import cx from "clsx";
7+
import { clsx } from "clsx";
88
import type { Route } from "./+types/_extras.blog.$slug";
99

1010
export const loader = async ({ params, request }: Route.LoaderArgs) => {
@@ -83,7 +83,7 @@ export default function BlogPost({ loaderData }: Route.ComponentProps) {
8383
<div className="relative h-[280px] bg-gray-900 md:mx-auto md:h-[400px] md:max-w-3xl md:rounded-xl xl:h-[480px]">
8484
<div className="absolute inset-0">
8585
<img
86-
className={cx(
86+
className={clsx(
8787
"h-full w-full object-cover object-top md:rounded-xl",
8888
!post.imageDisableOverlay && "opacity-40",
8989
)}
@@ -97,12 +97,17 @@ export default function BlogPost({ loaderData }: Route.ComponentProps) {
9797
{post.dateDisplay}
9898
</div>
9999
<div className="h-2" />
100-
<h1 className="font-display text-3xl font-extrabold text-white md:text-4xl">
100+
<h1
101+
className={clsx(
102+
"font-display font-extrabold text-white md:text-4xl",
103+
post.title.length > 50 ? "text-2xl" : "text-3xl",
104+
)}
105+
>
101106
{post.title}
102107
</h1>
103108
<div className="h-2" />
104109
</div>
105-
<div className="pb-4 md:pb-10">
110+
<div className="flex flex-col gap-1 pb-4 md:pb-10">
106111
{post.authors.map((author) => (
107112
<div key={author.name} className="flex items-center">
108113
<div>
@@ -114,7 +119,7 @@ export default function BlogPost({ loaderData }: Route.ComponentProps) {
114119
</div>
115120
<div className="w-6" />
116121
<div>
117-
<div className="font-display text-xl font-extrabold leading-none text-white md:text-3xl">
122+
<div className="font-display text-lg font-extrabold leading-none text-white md:text-3xl">
118123
{author.name}
119124
</div>
120125
<div className="text-base leading-tight text-white md:text-base">

0 commit comments

Comments
 (0)