Skip to content

Commit

Permalink
Add tailwind plugin and some small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjoeoui committed Oct 15, 2023
1 parent 1dbeda3 commit fe10a4f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": ["prettier-plugin-astro"],
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.astro",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier . --write"
"format": "prettier --plugin=prettier-plugin-astro --plugin=prettier-plugin-tailwindcss --write ."
},
"dependencies": {
"@astrojs/mdx": "^1.1.2",
Expand Down
1 change: 0 additions & 1 deletion src/components/home/LatestPosts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getCollection } from "astro:content";
import PostCard from "@/components/shared/PostCard.astro";
const publishedPostEntries = await getCollection("posts", ({ data }) => {
return data.isDraft !== true;
});
---
Expand Down
27 changes: 14 additions & 13 deletions src/components/shared/PostCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@ const { title, slug, date, isDraft } = Astro.props;
href={`/posts/${slug}`}
class="rounded-md border border-neutral-800 p-4 transition hover:bg-neutral-800"
>
<div class="text-md flex items-center gap-1 text-neutral-300">
<div>
<div class="text-md flex flex-col gap-1 sm:flex-row sm:items-center">
<div class="text-neutral-300">
{title}
</div>
<div class="grow"></div>
{
isDraft && (
<>
<div class="text-sm text-neutral-500">Draft</div>
<div class="px-0.5" />
</>
)
}
<div>
{date.toLocaleDateString("en-US", { month: "short", day: "numeric" })}
<div class="sm:grow"></div>
<div class="flex">
{
isDraft && (
<div class="order-2 px-2 text-sm text-neutral-500 sm:order-1">
Draft
</div>
)
}
<div class="order-1 sm:order-2">
{date.toLocaleDateString("en-US", { month: "short", day: "numeric" })}
</div>
</div>
</div>
</a>
2 changes: 1 addition & 1 deletion src/pages/posts/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const { Content } = await entry.render();

<div class="py-6"></div>

<Contact/>
<Contact />

<div class="py-2"></div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
}

.post h3 {
@apply my-1 flex gap-1 text-xl text-neutral-300 font-semibold;
@apply my-1 flex gap-1 text-xl font-semibold text-neutral-300;
}

.post p {
@apply my-0.5 text-base leading-relaxed text-neutral-400 py-2;
@apply my-0.5 py-2 text-base leading-relaxed text-neutral-400;
}

.post li {
Expand Down

0 comments on commit fe10a4f

Please sign in to comment.