Skip to content

Commit 359f82b

Browse files
authored
Merge pull request #371 from timlrx/prettier-tailwind
chore: prettier tailwind
2 parents 7bf39de + 2eaac5a commit 359f82b

26 files changed

+92
-82
lines changed

components/Card.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import Image from './Image'
22
import Link from './Link'
33

44
const Card = ({ title, description, imgSrc, href }) => (
5-
<div className="p-4 md:w-1/2 md" style={{ maxWidth: '544px' }}>
5+
<div className="md p-4 md:w-1/2" style={{ maxWidth: '544px' }}>
66
<div
77
className={`${
88
imgSrc && 'h-full'
9-
} overflow-hidden border-2 border-gray-200 rounded-md border-opacity-60 dark:border-gray-700`}
9+
} overflow-hidden rounded-md border-2 border-gray-200 border-opacity-60 dark:border-gray-700`}
1010
>
1111
{imgSrc &&
1212
(href ? (
1313
<Link href={href} aria-label={`Link to ${title}`}>
1414
<Image
1515
alt={title}
1616
src={imgSrc}
17-
className="object-cover object-center lg:h-48 md:h-36"
17+
className="object-cover object-center md:h-36 lg:h-48"
1818
width={544}
1919
height={306}
2020
/>
@@ -23,7 +23,7 @@ const Card = ({ title, description, imgSrc, href }) => (
2323
<Image
2424
alt={title}
2525
src={imgSrc}
26-
className="object-cover object-center lg:h-48 md:h-36"
26+
className="object-cover object-center md:h-36 lg:h-48"
2727
width={544}
2828
height={306}
2929
/>
@@ -38,7 +38,7 @@ const Card = ({ title, description, imgSrc, href }) => (
3838
title
3939
)}
4040
</h2>
41-
<p className="mb-3 prose text-gray-500 max-w-none dark:text-gray-400">{description}</p>
41+
<p className="prose mb-3 max-w-none text-gray-500 dark:text-gray-400">{description}</p>
4242
{href && (
4343
<Link
4444
href={href}

components/Footer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import SocialIcon from '@/components/social-icons'
55
export default function Footer() {
66
return (
77
<footer>
8-
<div className="flex flex-col items-center mt-16">
9-
<div className="flex mb-3 space-x-4">
8+
<div className="mt-16 flex flex-col items-center">
9+
<div className="mb-3 flex space-x-4">
1010
<SocialIcon kind="mail" href={`mailto:${siteMetadata.email}`} size="6" />
1111
<SocialIcon kind="github" href={siteMetadata.github} size="6" />
1212
<SocialIcon kind="facebook" href={siteMetadata.facebook} size="6" />
1313
<SocialIcon kind="youtube" href={siteMetadata.youtube} size="6" />
1414
<SocialIcon kind="linkedin" href={siteMetadata.linkedin} size="6" />
1515
<SocialIcon kind="twitter" href={siteMetadata.twitter} size="6" />
1616
</div>
17-
<div className="flex mb-2 space-x-2 text-sm text-gray-500 dark:text-gray-400">
17+
<div className="mb-2 flex space-x-2 text-sm text-gray-500 dark:text-gray-400">
1818
<div>{siteMetadata.author}</div>
1919
<div>{` • `}</div>
2020
<div>{${new Date().getFullYear()}`}</div>

components/LayoutWrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ThemeSwitch from './ThemeSwitch'
1010
const LayoutWrapper = ({ children }) => {
1111
return (
1212
<SectionContainer>
13-
<div className="flex flex-col justify-between h-screen">
13+
<div className="flex h-screen flex-col justify-between">
1414
<header className="flex items-center justify-between py-10">
1515
<div>
1616
<Link href="/" aria-label={siteMetadata.headerTitle}>
@@ -34,7 +34,7 @@ const LayoutWrapper = ({ children }) => {
3434
<Link
3535
key={link.title}
3636
href={link.href}
37-
className="p-1 font-medium text-gray-900 sm:p-4 dark:text-gray-100"
37+
className="p-1 font-medium text-gray-900 dark:text-gray-100 sm:p-4"
3838
>
3939
{link.title}
4040
</Link>

components/MobileNav.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const MobileNav = () => {
2121
<div className="sm:hidden">
2222
<button
2323
type="button"
24-
className="w-8 h-8 py-1 ml-1 mr-1 rounded"
24+
className="ml-1 mr-1 h-8 w-8 rounded py-1"
2525
aria-label="Toggle Menu"
2626
onClick={onToggleNav}
2727
>
@@ -47,17 +47,17 @@ const MobileNav = () => {
4747
</svg>
4848
</button>
4949
<div
50-
className={`fixed w-full h-full top-24 right-0 bg-gray-200 dark:bg-gray-800 opacity-95 z-10 transform ease-in-out duration-300 ${
50+
className={`fixed top-24 right-0 z-10 h-full w-full transform bg-gray-200 opacity-95 duration-300 ease-in-out dark:bg-gray-800 ${
5151
navShow ? 'translate-x-0' : 'translate-x-full'
5252
}`}
5353
>
5454
<button
5555
type="button"
5656
aria-label="toggle modal"
57-
className="fixed w-full h-full cursor-auto focus:outline-none"
57+
className="fixed h-full w-full cursor-auto focus:outline-none"
5858
onClick={onToggleNav}
5959
></button>
60-
<nav className="fixed h-full mt-8">
60+
<nav className="fixed mt-8 h-full">
6161
{headerNavLinks.map((link) => (
6262
<div key={link.title} className="px-12 py-4">
6363
<Link

components/NewsletterForm.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const NewsletterForm = ({ title = 'Subscribe to the newsletter' }) => {
4444
</label>
4545
<input
4646
autoComplete="email"
47-
className="px-4 rounded-md w-72 dark:bg-black focus:outline-none focus:ring-2 focus:border-transparent focus:ring-primary-600"
47+
className="w-72 rounded-md px-4 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-primary-600 dark:bg-black"
4848
id="email-input"
4949
name="email"
5050
placeholder={subscribed ? "You're subscribed ! 🎉" : 'Enter your email'}
@@ -54,11 +54,11 @@ const NewsletterForm = ({ title = 'Subscribe to the newsletter' }) => {
5454
disabled={subscribed}
5555
/>
5656
</div>
57-
<div className="flex w-full mt-2 rounded-md shadow-sm sm:mt-0 sm:ml-3">
57+
<div className="mt-2 flex w-full rounded-md shadow-sm sm:mt-0 sm:ml-3">
5858
<button
59-
className={`py-2 sm:py-0 w-full bg-primary-500 px-4 rounded-md font-medium text-white ${
59+
className={`w-full rounded-md bg-primary-500 py-2 px-4 font-medium text-white sm:py-0 ${
6060
subscribed ? 'cursor-default' : 'hover:bg-primary-700 dark:hover:bg-primary-400'
61-
} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-600 dark:ring-offset-black`}
61+
} focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-2 dark:ring-offset-black`}
6262
type="submit"
6363
disabled={subscribed}
6464
>
@@ -67,7 +67,7 @@ const NewsletterForm = ({ title = 'Subscribe to the newsletter' }) => {
6767
</div>
6868
</form>
6969
{error && (
70-
<div className="pt-2 text-sm text-red-500 w-72 sm:w-96 dark:text-red-400">{message}</div>
70+
<div className="w-72 pt-2 text-sm text-red-500 dark:text-red-400 sm:w-96">{message}</div>
7171
)}
7272
</div>
7373
)
@@ -77,7 +77,7 @@ export default NewsletterForm
7777

7878
export const BlogNewsletterForm = ({ title }) => (
7979
<div className="flex items-center justify-center">
80-
<div className="p-6 bg-gray-100 dark:bg-gray-800 sm:px-14 sm:py-8">
80+
<div className="bg-gray-100 p-6 dark:bg-gray-800 sm:px-14 sm:py-8">
8181
<NewsletterForm title={title} />
8282
</div>
8383
</div>

components/Pagination.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function Pagination({ totalPages, currentPage }) {
55
const nextPage = parseInt(currentPage) + 1 <= parseInt(totalPages)
66

77
return (
8-
<div className="pt-6 pb-8 space-y-2 md:space-y-5">
8+
<div className="space-y-2 pt-6 pb-8 md:space-y-5">
99
<nav className="flex justify-between">
1010
{!prevPage && (
1111
<button rel="previous" className="cursor-auto disabled:opacity-50" disabled={!prevPage}>

components/Pre.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ const Pre = (props) => {
2626
<button
2727
aria-label="Copy code"
2828
type="button"
29-
className={`absolute right-2 top-2 w-8 h-8 p-1 rounded border-2 bg-gray-700 dark:bg-gray-800 ${
29+
className={`absolute right-2 top-2 h-8 w-8 rounded border-2 bg-gray-700 p-1 dark:bg-gray-800 ${
3030
copied
31-
? 'focus:outline-none focus:border-green-400 border-green-400'
31+
? 'border-green-400 focus:border-green-400 focus:outline-none'
3232
: 'border-gray-300'
3333
}`}
3434
onClick={onCopy}

components/ScrollTopAndComment.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ const ScrollTopAndComment = () => {
2323
}
2424
return (
2525
<div
26-
className={`fixed flex-col hidden gap-3 right-8 bottom-8 ${show ? 'md:flex' : 'md:hidden'}`}
26+
className={`fixed right-8 bottom-8 hidden flex-col gap-3 ${show ? 'md:flex' : 'md:hidden'}`}
2727
>
2828
<button
2929
aria-label="Scroll To Comment"
3030
type="button"
3131
onClick={handleScrollToComment}
32-
className="p-2 text-gray-500 transition-all bg-gray-200 rounded-full dark:text-gray-400 dark:bg-gray-700 dark:hover:bg-gray-600 hover:bg-gray-300"
32+
className="rounded-full bg-gray-200 p-2 text-gray-500 transition-all hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600"
3333
>
34-
<svg className="w-5 h-5" viewBox="0 0 20 20" fill="currentColor">
34+
<svg className="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
3535
<path
3636
fillRule="evenodd"
3737
d="M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z"
@@ -43,9 +43,9 @@ const ScrollTopAndComment = () => {
4343
aria-label="Scroll To Top"
4444
type="button"
4545
onClick={handleScrollTop}
46-
className="p-2 text-gray-500 transition-all bg-gray-200 rounded-full dark:text-gray-400 dark:bg-gray-700 dark:hover:bg-gray-600 hover:bg-gray-300"
46+
className="rounded-full bg-gray-200 p-2 text-gray-500 transition-all hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600"
4747
>
48-
<svg className="w-5 h-5" viewBox="0 0 20 20" fill="currentColor">
48+
<svg className="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
4949
<path
5050
fillRule="evenodd"
5151
d="M3.293 9.707a1 1 0 010-1.414l6-6a1 1 0 011.414 0l6 6a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L4.707 9.707a1 1 0 01-1.414 0z"

components/SectionContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default function SectionContainer({ children }) {
2-
return <div className="max-w-3xl px-4 mx-auto sm:px-6 xl:max-w-5xl xl:px-0">{children}</div>
2+
return <div className="mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0">{children}</div>
33
}

components/TOCInline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const TOCInline = ({
5151
<>
5252
{asDisclosure ? (
5353
<details open>
54-
<summary className="pt-2 pb-2 ml-6 text-xl font-bold">Table of Contents</summary>
54+
<summary className="ml-6 pt-2 pb-2 text-xl font-bold">Table of Contents</summary>
5555
<div className="ml-6">{tocList}</div>
5656
</details>
5757
) : (

0 commit comments

Comments
 (0)