Skip to content

Commit

Permalink
Merge pull request #54 from brown-ccv/refactor-news-styling
Browse files Browse the repository at this point in the history
refactor: updated news styling
  • Loading branch information
galenwinsor authored Jun 26, 2024
2 parents d4745eb + 6a50bdb commit b1ba812
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/FormattedDate.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
const { date } = Astro.props;
---

<time datetime={date.toISOString()}>
<time datetime={date.toISOString()} class="text-neutral-500">
{
date.toLocaleDateString('en-us', {
year: 'numeric',
Expand Down
4 changes: 1 addition & 3 deletions src/components/HeaderLink.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const isActive = href === pathname || href === "/" + subpath?.[0]
class:list={[
className,
"hover:underline underline-offset-8",
{
"text-neutral-900 font-semibold underline": isActive,
},
isActive ? "text-neutral-900 font-semibold underline" : "no-underline",
]}
{...props}
>
Expand Down
26 changes: 12 additions & 14 deletions src/layouts/News.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props
---

<Layout title={title} description={description}>
<article>
<article class="flex flex-col gap-16">
<div class="flex flex-col gap-4">
<div>
{heroImage && <img width={1020} height={510} src={heroImage} alt="" />}
</div>
<div>
<div>
<div>
<FormattedDate date={pubDate} />
{
updatedDate && (
<div class="last-updated-on">
Last updated on
<FormattedDate date={updatedDate} />
</div>
)
}
<FormattedDate date={pubDate} />
{
updatedDate && (
<div class="last-updated-on">
Last updated on
<FormattedDate date={updatedDate} />
</div>
</div>
)
}
</div>
<div class="flex flex-col gap-4">
<slot />
</div>
</article>
Expand Down
8 changes: 8 additions & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
@apply text-neutral-700;
}

p {
@apply leading-8;
}

a {
@apply underline;
}

p.small {
@apply text-base;
@apply text-neutral-500;
Expand Down

0 comments on commit b1ba812

Please sign in to comment.