Skip to content

Commit

Permalink
Add tailwind prettier plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
morr0ne committed Jun 30, 2024
1 parent 7d2e5fb commit a006d77
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export default {
semi: true,
singleQuote: true,
plugins: ['prettier-plugin-astro'],
plugins: ['prettier-plugin-astro', 'prettier-plugin-tailwindcss'],
overrides: [
{
files: '*.astro',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"devDependencies": {
"husky": "^9.0.11",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.14.0"
"prettier-plugin-astro": "^0.14.0",
"prettier-plugin-tailwindcss": "^0.6.5"
}
}
61 changes: 61 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import HeaderLink from './HeaderLink.astro';
import { Icon } from 'astro-icon/components';
---

<header class="flex flex-row justify-between align-center text-xl my-4">
<header class="align-center my-4 flex flex-row justify-between text-xl">
<HeaderLink href="/">Home</HeaderLink>
<nav class="flex flex-row">
<HeaderLink class="mx-2" href="/posts">Posts</HeaderLink>
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderLink.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ type Props = HTMLAttributes<'a'>;
const { href, class: className } = Astro.props;
---

<a href={href} class:list={[className, 'hover:underline flex items-center']}>
<a href={href} class:list={[className, 'flex items-center hover:underline']}>
<slot />
</a>
4 changes: 2 additions & 2 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const { title, description } = Astro.props;
<meta property="twitter:description" content={description} />
<!-- <meta property="twitter:image" content={new URL(image, Astro.url)} /> -->
</head>
<body class="bg-neutral-900 text-white font-mono">
<div class="max-w-5xl m-auto h-screen flex flex-col justify-between">
<body class="bg-neutral-900 font-mono text-white">
<div class="m-auto flex h-screen max-w-5xl flex-col justify-between">
<Header />
<main class="flex-1">
<slot />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import Base from '@layouts/Base.astro';

<Base title={SITE_TITLE} description={SITE_DESCRIPTION}>
<div
class="flex flex-col min-h-full text-6xl md:text-8xl justify-center max-w-fit"
class="flex min-h-full max-w-fit flex-col justify-center text-6xl md:text-8xl"
>
(づ。◕‿‿◕。)づ
<span class="text-xl text-right">Soon™</span>
<span class="text-right text-xl">Soon™</span>
</div>
</Base>
2 changes: 1 addition & 1 deletion src/pages/posts/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const posts = (await getCollection('blog')).sort(
{
posts.map((post) => (
<li>
<div class="grid grid-flow-col auto-cols-max gap-4">
<div class="grid auto-cols-max grid-flow-col gap-4">
<FormattedDate date={post.data.pubDate} />
<a href={`/posts/${post.slug}/`}>
<h1 class="title">{post.data.title}</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const posts = await getCollection('projects');
{
posts.map((post) => (
<li>
<div class="grid grid-flow-col auto-cols-max gap-4">
<div class="grid auto-cols-max grid-flow-col gap-4">
<a href={`/projects/${post.slug}/`}>
<h1 class="title">{post.data.title}</h1>
</a>
Expand Down

0 comments on commit a006d77

Please sign in to comment.