Skip to content

Commit

Permalink
Merge pull request #1111 from timlrx/tailwind-v4
Browse files Browse the repository at this point in the history
Tailwind v4
  • Loading branch information
timlrx authored Feb 9, 2025
2 parents d00edcb + 2002c6d commit cdc1099
Show file tree
Hide file tree
Showing 27 changed files with 1,326 additions and 1,302 deletions.
12 changes: 6 additions & 6 deletions app/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export default function Home({ posts }) {
return (
<>
<div className="divide-y divide-gray-200 dark:divide-gray-700">
<div className="space-y-2 pb-8 pt-6 md:space-y-5">
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14">
<div className="space-y-2 pt-6 pb-8 md:space-y-5">
<h1 className="text-3xl leading-9 font-extrabold tracking-tight text-gray-900 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14 dark:text-gray-100">
Latest
</h1>
<p className="text-lg leading-7 text-gray-500 dark:text-gray-400">
Expand All @@ -28,14 +28,14 @@ export default function Home({ posts }) {
<div className="space-y-2 xl:grid xl:grid-cols-4 xl:items-baseline xl:space-y-0">
<dl>
<dt className="sr-only">Published on</dt>
<dd className="text-base font-medium leading-6 text-gray-500 dark:text-gray-400">
<dd className="text-base leading-6 font-medium text-gray-500 dark:text-gray-400">
<time dateTime={date}>{formatDate(date, siteMetadata.locale)}</time>
</dd>
</dl>
<div className="space-y-5 xl:col-span-3">
<div className="space-y-6">
<div>
<h2 className="text-2xl font-bold leading-8 tracking-tight">
<h2 className="text-2xl leading-8 font-bold tracking-tight">
<Link
href={`/blog/${slug}`}
className="text-gray-900 dark:text-gray-100"
Expand All @@ -53,7 +53,7 @@ export default function Home({ posts }) {
{summary}
</div>
</div>
<div className="text-base font-medium leading-6">
<div className="text-base leading-6 font-medium">
<Link
href={`/blog/${slug}`}
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"
Expand All @@ -71,7 +71,7 @@ export default function Home({ posts }) {
</ul>
</div>
{posts.length > MAX_DISPLAY && (
<div className="flex justify-end text-base font-medium leading-6">
<div className="flex justify-end text-base leading-6 font-medium">
<Link
href="/blog"
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"
Expand Down
8 changes: 4 additions & 4 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import Link from '@/components/Link'
export default function NotFound() {
return (
<div className="flex flex-col items-start justify-start md:mt-24 md:flex-row md:items-center md:justify-center md:space-x-6">
<div className="space-x-2 pb-8 pt-6 md:space-y-5">
<h1 className="text-6xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 md:border-r-2 md:px-6 md:text-8xl md:leading-14">
<div className="space-x-2 pt-6 pb-8 md:space-y-5">
<h1 className="text-6xl leading-9 font-extrabold tracking-tight text-gray-900 md:border-r-2 md:px-6 md:text-8xl md:leading-14 dark:text-gray-100">
404
</h1>
</div>
<div className="max-w-md">
<p className="mb-4 text-xl font-bold leading-normal md:text-2xl">
<p className="mb-4 text-xl leading-normal font-bold md:text-2xl">
Sorry we couldn't find this page.
</p>
<p className="mb-8">But dont worry, you can find plenty of other things on our homepage.</p>
<Link
href="/"
className="focus:shadow-outline-blue inline rounded-lg border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium leading-5 text-white shadow transition-colors duration-150 hover:bg-blue-700 focus:outline-none dark:hover:bg-blue-500"
className="focus:shadow-outline-blue inline rounded-lg border border-transparent bg-blue-600 px-4 py-2 text-sm leading-5 font-medium text-white shadow-xs transition-colors duration-150 hover:bg-blue-700 focus:outline-hidden dark:hover:bg-blue-500"
>
Back to homepage
</Link>
Expand Down
4 changes: 2 additions & 2 deletions app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function Projects() {
return (
<>
<div className="divide-y divide-gray-200 dark:divide-gray-700">
<div className="space-y-2 pb-8 pt-6 md:space-y-5">
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14">
<div className="space-y-2 pt-6 pb-8 md:space-y-5">
<h1 className="text-3xl leading-9 font-extrabold tracking-tight text-gray-900 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14 dark:text-gray-100">
Projects
</h1>
<p className="text-lg leading-7 text-gray-500 dark:text-gray-400">
Expand Down
10 changes: 5 additions & 5 deletions app/tags/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ export default async function Page() {
const sortedTags = tagKeys.sort((a, b) => tagCounts[b] - tagCounts[a])
return (
<>
<div className="flex flex-col items-start justify-start divide-y divide-gray-200 dark:divide-gray-700 md:mt-24 md:flex-row md:items-center md:justify-center md:space-x-6 md:divide-y-0">
<div className="space-x-2 pb-8 pt-6 md:space-y-5">
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:border-r-2 md:px-6 md:text-6xl md:leading-14">
<div className="flex flex-col items-start justify-start divide-y divide-gray-200 md:mt-24 md:flex-row md:items-center md:justify-center md:space-x-6 md:divide-y-0 dark:divide-gray-700">
<div className="space-x-2 pt-6 pb-8 md:space-y-5">
<h1 className="text-3xl leading-9 font-extrabold tracking-tight text-gray-900 sm:text-4xl sm:leading-10 md:border-r-2 md:px-6 md:text-6xl md:leading-14 dark:text-gray-100">
Tags
</h1>
</div>
<div className="flex max-w-lg flex-wrap">
{tagKeys.length === 0 && 'No tags found.'}
{sortedTags.map((t) => {
return (
<div key={t} className="mb-2 mr-5 mt-2">
<div key={t} className="mt-2 mr-5 mb-2">
<Tag text={t} />
<Link
href={`/tags/${slug(t)}`}
className="-ml-2 text-sm font-semibold uppercase text-gray-600 dark:text-gray-300"
className="-ml-2 text-sm font-semibold text-gray-600 uppercase dark:text-gray-300"
aria-label={`View posts tagged ${t}`}
>
{` (${tagCounts[t]})`}
Expand Down
6 changes: 3 additions & 3 deletions components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Card = ({ title, description, imgSrc, href }) => (
<div
className={`${
imgSrc && 'h-full'
} overflow-hidden rounded-md border-2 border-gray-200 border-opacity-60 dark:border-gray-700`}
} overflow-hidden rounded-md border-2 border-gray-200/60 dark:border-gray-700/60`}
>
{imgSrc &&
(href ? (
Expand All @@ -29,7 +29,7 @@ const Card = ({ title, description, imgSrc, href }) => (
/>
))}
<div className="p-6">
<h2 className="mb-3 text-2xl font-bold leading-8 tracking-tight">
<h2 className="mb-3 text-2xl leading-8 font-bold tracking-tight">
{href ? (
<Link href={href} aria-label={`Link to ${title}`}>
{title}
Expand All @@ -42,7 +42,7 @@ const Card = ({ title, description, imgSrc, href }) => (
{href && (
<Link
href={href}
className="text-base font-medium leading-6 text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400 text-base leading-6 font-medium"
aria-label={`Link to ${title}`}
>
Learn more &rarr;
Expand Down
6 changes: 3 additions & 3 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ const Header = () => {
)}
</div>
</Link>
<div className="flex items-center space-x-4 leading-5 sm:space-x-6">
<div className="no-scrollbar hidden max-w-40 items-center space-x-4 overflow-x-auto pr-2 sm:flex sm:space-x-6 md:max-w-72 lg:max-w-96">
<div className="flex items-center space-x-4 leading-5 sm:-mr-6 sm:space-x-6">
<div className="no-scrollbar hidden max-w-40 items-center gap-x-4 overflow-x-auto sm:flex md:max-w-72 lg:max-w-96">
{headerNavLinks
.filter((link) => link.href !== '/')
.map((link) => (
<Link
key={link.title}
href={link.href}
className="m-1 block font-medium text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
className="hover:text-primary-500 dark:hover:text-primary-400 m-1 font-medium text-gray-900 dark:text-gray-100"
>
{link.title}
</Link>
Expand Down
22 changes: 11 additions & 11 deletions components/MobileNav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { Dialog, Transition } from '@headlessui/react'
import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react'
import { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock'
import { Fragment, useState, useEffect, useRef } from 'react'
import Link from './Link'
Expand Down Expand Up @@ -33,7 +33,7 @@ const MobileNav = () => {
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
className="h-8 w-8 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
className="hover:text-primary-500 dark:hover:text-primary-400 h-8 w-8 text-gray-900 dark:text-gray-100"
>
<path
fillRule="evenodd"
Expand All @@ -44,7 +44,7 @@ const MobileNav = () => {
</button>
<Transition appear show={navShow} as={Fragment} unmount={false}>
<Dialog as="div" onClose={onToggleNav} unmount={false}>
<Transition.Child
<TransitionChild
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0"
Expand All @@ -55,9 +55,9 @@ const MobileNav = () => {
unmount={false}
>
<div className="fixed inset-0 z-60 bg-black/25" />
</Transition.Child>
</TransitionChild>

<Transition.Child
<TransitionChild
as={Fragment}
enter="transition ease-in-out duration-300 transform"
enterFrom="translate-x-full opacity-0"
Expand All @@ -67,16 +67,16 @@ const MobileNav = () => {
leaveTo="translate-x-full opacity-0"
unmount={false}
>
<Dialog.Panel className="fixed left-0 top-0 z-70 h-full w-full bg-white opacity-95 duration-300 dark:bg-gray-950 dark:opacity-[0.98]">
<DialogPanel className="fixed top-0 left-0 z-70 h-full w-full bg-white/95 duration-300 dark:bg-gray-950/98">
<nav
ref={navRef}
className="mt-8 flex h-full basis-0 flex-col items-start overflow-y-auto pl-12 pt-2 text-left"
className="mt-8 flex h-full basis-0 flex-col items-start overflow-y-auto pt-2 pl-12 text-left"
>
{headerNavLinks.map((link) => (
<Link
key={link.title}
href={link.href}
className="mb-4 py-2 pr-4 text-2xl font-bold tracking-widest text-gray-900 outline outline-0 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
className="hover:text-primary-500 dark:hover:text-primary-400 mb-4 py-2 pr-4 text-2xl font-bold tracking-widest text-gray-900 outline outline-0 dark:text-gray-100"
onClick={onToggleNav}
>
{link.title}
Expand All @@ -85,7 +85,7 @@ const MobileNav = () => {
</nav>

<button
className="fixed right-4 top-7 z-80 h-16 w-16 p-4 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
className="hover:text-primary-500 dark:hover:text-primary-400 fixed top-7 right-4 z-80 h-16 w-16 p-4 text-gray-900 dark:text-gray-100"
aria-label="Toggle Menu"
onClick={onToggleNav}
>
Expand All @@ -97,8 +97,8 @@ const MobileNav = () => {
/>
</svg>
</button>
</Dialog.Panel>
</Transition.Child>
</DialogPanel>
</TransitionChild>
</Dialog>
</Transition>
</>
Expand Down
2 changes: 1 addition & 1 deletion components/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {

export default function PageTitle({ children }: Props) {
return (
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-5xl md:leading-14">
<h1 className="text-3xl leading-9 font-extrabold tracking-tight text-gray-900 sm:text-4xl sm:leading-10 md:text-5xl md:leading-14 dark:text-gray-100">
{children}
</h1>
)
Expand Down
2 changes: 1 addition & 1 deletion components/ScrollTopAndComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ScrollTopAndComment = () => {
}
return (
<div
className={`fixed bottom-8 right-8 hidden flex-col gap-3 ${show ? 'md:flex' : 'md:hidden'}`}
className={`fixed right-8 bottom-8 hidden flex-col gap-3 ${show ? 'md:flex' : 'md:hidden'}`}
>
{siteMetadata.comments?.provider && (
<button
Expand Down
3 changes: 1 addition & 2 deletions components/SearchButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ const SearchButton = () => {
viewBox="0 0 24 24"
strokeWidth={1.5}
stroke="currentColor"
className="h-6 w-6 text-gray-900 hover:text-primary-500 dark:text-gray-100
dark:hover:text-primary-400"
className="hover:text-primary-500 dark:hover:text-primary-400 h-6 w-6 text-gray-900 dark:text-gray-100"
>
<path
strokeLinecap="round"
Expand Down
2 changes: 1 addition & 1 deletion components/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Tag = ({ text }: Props) => {
return (
<Link
href={`/tags/${slug(text)}`}
className="mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400 mr-3 text-sm font-medium uppercase"
>
{text.split(' ').join('-')}
</Link>
Expand Down
6 changes: 3 additions & 3 deletions components/ThemeSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const ThemeSwitch = () => {
useEffect(() => setMounted(true), [])

return (
<div className="mr-5 flex items-center">
<div className="flex items-center">
<Menu as="div" className="relative inline-block text-left">
<div className="flex items-center justify-center hover:text-primary-500 dark:hover:text-primary-400">
<div className="hover:text-primary-500 dark:hover:text-primary-400 flex items-center justify-center">
<MenuButton aria-label="Theme switcher">
{mounted ? resolvedTheme === 'dark' ? <Moon /> : <Sun /> : <Blank />}
</MenuButton>
Expand All @@ -78,7 +78,7 @@ const ThemeSwitch = () => {
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
<MenuItems className="absolute right-0 z-50 mt-2 w-32 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-gray-800">
<MenuItems className="ring-opacity-5 absolute right-0 z-50 mt-2 w-32 origin-top-right divide-y divide-gray-100 rounded-md bg-white ring-1 shadow-lg ring-black focus:outline-hidden dark:bg-gray-800">
<RadioGroup value={theme} onChange={setTheme}>
<div className="p-1">
<Radio value="light">
Expand Down
2 changes: 1 addition & 1 deletion components/social-icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const SocialIcon = ({ kind, href, size = 8 }: SocialIconProps) => {
>
<span className="sr-only">{kind}</span>
<SocialSvg
className={`fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-${size} w-${size}`}
className={`hover:text-primary-500 dark:hover:text-primary-400 fill-current text-gray-700 dark:text-gray-200 h-${size} w-${size}`}
/>
</a>
)
Expand Down
18 changes: 8 additions & 10 deletions css/prism.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@reference "./tailwind.css";

/**
* CSS Styles for code highlighting.
* Feel free to customize token styles
Expand All @@ -7,7 +9,7 @@

/* Code title styles */
.remark-code-title {
@apply rounded-t bg-gray-700 px-5 py-3 font-mono text-sm font-bold text-gray-200 dark:bg-gray-800;
@apply rounded-xs bg-gray-700 px-5 py-3 font-mono text-sm font-bold text-gray-200 dark:bg-gray-800;
}

.remark-code-title + div > pre {
Expand All @@ -20,23 +22,23 @@
}

.code-line {
@apply -mx-4 block border-l-4 border-transparent pl-4 pr-4;
@apply -mx-4 block border-l-4 border-transparent pr-4 pl-4;
}

.code-line.inserted {
@apply bg-green-500 bg-opacity-20;
@apply bg-green-500/20;
}

.code-line.deleted {
@apply bg-red-500 bg-opacity-20;
@apply bg-red-500/20;
}

.highlight-line {
@apply -mx-4 border-l-4 border-primary-500 bg-gray-700 bg-opacity-50;
@apply border-primary-500 -mx-4 border-l-4 bg-gray-700/50;
}

.line-number::before {
@apply -ml-2 mr-4 inline-block w-4 text-right text-gray-400;
@apply mr-4 -ml-2 inline-block w-4 text-right text-gray-400;
content: attr(line);
}

Expand Down Expand Up @@ -138,7 +140,3 @@
.token.table {
display: inline;
}

.token.table {
display: inline;
}
Loading

0 comments on commit cdc1099

Please sign in to comment.