Skip to content

style: migrate to tailwind v4 #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions app/article/[[...categories]]/page.module.css

This file was deleted.

15 changes: 8 additions & 7 deletions app/article/[[...categories]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { CategoriesSelector } from '~/components/Common/CategoriesSelector/index.tsx';
import { ArticleCard } from '~/components/Post/ArticleCard/index.tsx';
import { getPostsMetadata } from '~/lib/post.ts';
import styles from './page.module.css';
import type { FC } from 'react';

Check failure on line 4 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

Cannot find module 'react' or its corresponding type declarations.
import type { Metadata } from 'next';

Check failure on line 5 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

Cannot find module 'next' or its corresponding type declarations.

type CategoriesParams = {
categories?: string[];
Expand Down Expand Up @@ -55,27 +54,29 @@
};
};

const Page: FC<PageProps> = async ({ params }) => {

Check failure on line 57 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

Binding element 'params' implicitly has an 'any' type.
const currentCategories = (await params).categories || [];
const postsMetadata = await getPostsMetadata(currentCategories[0]);

return (
<main className={styles.page}>
<h1>Article list</h1>
<p>
<main className="container mx-auto px-4 py-8">

Check failure on line 62 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
<h1 className="mb-4 font-bold text-3xl lg:text-4xl">Article list</h1>

Check failure on line 63 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.

Check failure on line 63 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
<p className="mb-4 max-w-screen-md text-gray-500 dark:text-gray-400">

Check failure on line 64 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
Here you can find all the articles available on the website. You can
filter them by category using the dropdown below.
</p>

Check failure on line 67 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
<CategoriesSelector
currentCategories={currentCategories}
categories={CATEGORIES}
/>
{postsMetadata.length === 0 ? (
<div className={styles.noArticles}>
<p>No articles here for now</p>
<div className="mt-8">

Check failure on line 73 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
<p className="ext-transparent bg-gradient-to-r from-green-300 to-green-800 bg-clip-text text-center font-black text-3xl">

Check failure on line 74 in app/article/[[...categories]]/page.tsx

View workflow job for this annotation

GitHub Actions / quality

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
No articles here for now
</p>
</div>
) : (
<div className={styles.articles}>
<div className="grid grid-cols-1 justify-center gap-4 md:grid-cols-2 lg:grid-cols-3">
{postsMetadata.map(post => (
<ArticleCard key={post.slug} {...post} />
))}
Expand Down
5 changes: 0 additions & 5 deletions app/article/post/[article]/page.module.css

This file was deleted.

3 changes: 1 addition & 2 deletions app/article/post/[article]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { notFound } from 'next/navigation';
import { getContent } from '~/lib/content.ts';
import { getAllPosts } from '~/lib/post.ts';
import { ArticleHeader } from '~/components/Post/ArticleHeader/index.tsx';
import styles from './page.module.css';
import type { FC } from 'react';
import type { Metadata } from 'next';
import type { PostFrontmatter } from '~/types/frontmatter';
Expand Down Expand Up @@ -54,7 +53,7 @@ const Page: FC<PageProps> = async ({ params }) => {
const { content, frontmatter } = mdxResult;

return (
<main className={styles.page}>
<main className="container mx-auto px-4">
<ArticleHeader
title={frontmatter.title}
description={frontmatter.description}
Expand Down
5 changes: 0 additions & 5 deletions components/Common/AuthorsList/index.module.css

This file was deleted.

3 changes: 1 addition & 2 deletions components/Common/AuthorsList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getGitHubAvatarUrl, getGithubProfileUrl } from '~/utils/gitHubUtils';
import { getAcronymFromString } from '~/utils/stringUtils';
import { Avatar, AvatarImage, AvatarFallback } from '../Avatar/index.tsx';
import styles from './index.module.css';
import type { FC } from 'react';

type AuthorsListProps = {
Expand All @@ -23,5 +22,5 @@ export const AuthorsList: FC<AuthorsListProps> = ({ authors }) => {
</Avatar>
));

return <div className={styles.wrapper}>{authorsList}</div>;
return <div className="flex space-x-2 py-2">{authorsList}</div>;
};
40 changes: 0 additions & 40 deletions components/Common/Avatar/index.module.css

This file was deleted.

13 changes: 9 additions & 4 deletions components/Common/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import classNames from 'classnames';
import styles from './index.module.css';
import type { ComponentProps } from 'react';

const Avatar = ({
Expand All @@ -11,7 +10,10 @@ const Avatar = ({
}: ComponentProps<typeof AvatarPrimitive.Root>) => (
<AvatarPrimitive.Root
ref={ref}
className={classNames(className, styles.root)}
className={classNames(
className,
'flex size-10 shrink-0 overflow-hidden rounded-md shadow-green-300 shadow-sm outline-2 outline-green-300 transition-shadow hover:shadow-green-400 hover:shadow-md dark:shadow-green-800 dark:outline-green-800 hover:dark:shadow-green-700'
)}
{...props}
/>
);
Expand All @@ -25,7 +27,7 @@ const AvatarImage = ({
}: ComponentProps<typeof AvatarPrimitive.Image>) => (
<AvatarPrimitive.Image
ref={ref}
className={classNames(styles.image, className)}
className={classNames('aspect-square size-full', className)}
{...props}
/>
);
Expand All @@ -39,7 +41,10 @@ const AvatarFallback = ({
}: ComponentProps<typeof AvatarPrimitive.Fallback>) => (
<AvatarPrimitive.Fallback
ref={ref}
className={classNames(styles.fallback, className)}
className={classNames(
'flex size-full items-center justify-center rounded-md bg-green-100 font-bold text-base text-black dark:bg-green-800 dark:text-white',
className
)}
{...props}
/>
);
Expand Down
59 changes: 23 additions & 36 deletions components/Common/Button/index.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@reference "../../../styles/globals.css";

.button {
@apply rounded
@apply rounded-sm
inline-flex
items-center
justify-center
Expand All @@ -8,15 +10,9 @@
py-2
transition
duration-300
ease-in-out;

&:focus {
@apply outline-none;
}

svg {
@apply size-5;
}
ease-in-out
focus:outline-none
has-[svg]:*:size-5;
}

.primary {
Expand All @@ -26,15 +22,12 @@
bg-green-500
text-white
dark:bg-green-400
dark:text-gray-900;

&:hover {
@apply border-gray-600
bg-transparent
text-gray-600
dark:text-gray-300
dark:border-gray-300;
}
dark:text-gray-900
hover:border-gray-600
hover:bg-transparent
hover:text-gray-600
hover:dark:text-gray-300
hover:dark:border-gray-300;
}

.secondary {
Expand All @@ -44,15 +37,12 @@
bg-gray-600
text-white
dark:bg-gray-300
dark:text-gray-900;

&:hover {
@apply border-gray-600
bg-transparent
text-gray-600
dark:text-gray-300
dark:border-gray-300;
}
dark:text-gray-900
hover:border-gray-600
hover:bg-transparent
hover:text-gray-600
hover:dark:text-gray-300
hover:dark:border-gray-300;
}

.special {
Expand All @@ -62,12 +52,9 @@
bg-transparent
text-gray-600
dark:text-gray-300
dark:border-gray-300;

&:hover {
@apply bg-green-500
text-white
dark:bg-green-400
dark:text-gray-900;
}
dark:border-gray-300
hover:bg-green-500
hover:text-white
hover:dark:bg-green-400
hover:dark:text-gray-900;
}
31 changes: 0 additions & 31 deletions components/Common/CategoriesSelector/index.module.css

This file was deleted.

16 changes: 9 additions & 7 deletions components/Common/CategoriesSelector/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import classNames from 'classnames';
import styles from './index.module.css';
import type { FC } from 'react';

type CategoriesSelectorProps = {
Expand All @@ -14,15 +13,18 @@ export const CategoriesSelector: FC<CategoriesSelectorProps> = ({
currentCategories,
categories,
}) => (
<ul className={styles.categoriesSelector}>
<ul className="mb-4 flex space-x-2 border-green-400 border-b-4 text-gray-800 dark:border-green-600 dark:text-gray-200">
{categories.map((category, i) => (
<li
key={category.slug}
className={classNames(styles.item, {
[styles.active]:
(currentCategories.length === 0 && i === 0) ||
currentCategories.includes(category.slug),
})}
className={classNames(
'flex cursor-pointer items-center rounded-t-md px-2 py-1 transition duration-200 hover:bg-green-400 hover:text-white dark:hover:bg-green-600 dark:hover:text-white',
{
'bg-green-400 text-white dark:bg-green-600':
(currentCategories.length === 0 && i === 0) ||
currentCategories.includes(category.slug),
}
)}
>
<a href={`/article/${category.slug}`.replace(/\/$/, '')}>
{category.category}
Expand Down
Loading
Loading