Skip to content

Commit

Permalink
feat: setup tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
sripwoud committed Feb 17, 2025
1 parent 7a34c9f commit c9adbf6
Show file tree
Hide file tree
Showing 10 changed files with 238 additions and 33 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "module",
"dependencies": {
"@hazae41/option": "^1.1.4",
"@tailwindcss/vite": "^4.0.6",
"@tanstack/react-form": "^0.42.0",
"@tanstack/react-query": "^5.66.3",
"@tanstack/react-router": "^1.105.0",
Expand All @@ -13,6 +14,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-spinners": "^0.15.0",
"tailwindcss": "^4.0.6",
"zod": "^3.24.2"
},
"devDependencies": {
Expand Down
8 changes: 1 addition & 7 deletions web/src/components/ExternalLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ interface ExternalLinkProps {

export const ExternalLink: FC<ExternalLinkProps> = ({
children,
className,
href,
}: ExternalLinkProps) => (
<a
className={className}
href={href}
rel='noopener noreferrer'
target='_blank'
>
<a href={href} rel='noopener noreferrer' target='_blank'>
{children}
</a>
)
2 changes: 1 addition & 1 deletion web/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { config } from 'l/config'
import { Github } from 'lucide-react'

export const Footer = () => (
<footer style={{ textAlign: 'center' }}>
<footer className='flex justify-center items-center py-4'>
<ExternalLink href={`https://github.com/sripwoud/${config.appName}`}>
<Github size={20} />
</ExternalLink>
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/Latom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export const Latom = () => {
</button>
),
(value) => (
<>
<span>{value}</span>
<div className='flex items-center gap-2'>
<button type='button' onClick={reset}>
Reset
</button>
</>
<span>{value}</span>
</div>
),
)
}
10 changes: 2 additions & 8 deletions web/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ import { Header } from 'c/Header'

export function Layout() {
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
minHeight: '100vh',
}}
>
<div className='flex flex-col min-h-screen px-4 pt-4'>
<Header />
<main style={{ flexGrow: 1 }}>
<main className='flex-1 overflow-hidden pt-4'>
<Outlet />
</main>
<ReactQueryDevtools />
Expand Down
33 changes: 28 additions & 5 deletions web/src/global.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
html,
body {
height: 100%;
margin: 0;
padding: 0 1em;
@import "tailwindcss";

@layer base {
a {
@apply text-fuchsia-600 hover:text-fuchsia-700;
}

a:hover {
@apply underline;
}

input {
@apply border border-gray-300 px-2 py-1 rounded outline-none
focus:border-fuchsia-400 focus:ring focus:ring-fuchsia-100
transition-colors duration-150 ease-in-out;
}

button {
@apply px-4 py-2 rounded
bg-fuchsia-600 text-white font-semibold
hover:bg-fuchsia-700
disabled:bg-gray-300 disabled:cursor-not-allowed
transition-colors duration-150;
}

button:focus {
@apply ring-2 ring-fuchsia-400;
}
}
9 changes: 3 additions & 6 deletions web/src/routes/query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ export const Route = createFileRoute('/query')({
function component() {
const users: UserProps[] = Route.useLoaderData()
return (
<div>
Hello "/users"!
<ul>
{users.map((user) => <li key={user.id}>{user.name}</li>)}
</ul>
</div>
<ul className='list-disc list-inside'>
{users.map((user) => <li key={user.id}>{user.name}</li>)}
</ul>
)
}
3 changes: 2 additions & 1 deletion web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import tailwindcss from '@tailwindcss/vite'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'

const plugins = [tsconfigPaths(), TanStackRouterVite(), react()]
const plugins = [react(), tailwindcss(), TanStackRouterVite(), tsconfigPaths()]

export default defineConfig(({ mode }) => {
return {
Expand Down
Loading

0 comments on commit c9adbf6

Please sign in to comment.