Unverified Commit 9a2d97cc authored by Florentin / 珞辰's avatar Florentin / 珞辰 Committed by GitHub

[examples] Add new Tailwind CSS Prettier plugin to example (#33614)

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

This PR adds the new official plugin for class sorting from Tailwind Labs to the Tailwind example.
Rel: https://tailwindcss.com/blog/automatic-class-sorting-with-prettier
parent 562439d7
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
"@types/react": "17.0.38", "@types/react": "17.0.38",
"autoprefixer": "^10.4.0", "autoprefixer": "^10.4.0",
"postcss": "^8.4.5", "postcss": "^8.4.5",
"prettier": "^2.5.1",
"prettier-plugin-tailwindcss": "^0.1.1",
"tailwindcss": "^3.0.7", "tailwindcss": "^3.0.7",
"typescript": "4.5.4" "typescript": "4.5.4"
} }
......
...@@ -2,13 +2,13 @@ import Head from 'next/head' ...@@ -2,13 +2,13 @@ import Head from 'next/head'
export default function Home() { export default function Home() {
return ( return (
<div className="flex flex-col items-center justify-center min-h-screen py-2"> <div className="flex min-h-screen flex-col items-center justify-center py-2">
<Head> <Head>
<title>Create Next App</title> <title>Create Next App</title>
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
</Head> </Head>
<main className="flex flex-col items-center justify-center w-full flex-1 px-20 text-center"> <main className="flex w-full flex-1 flex-col items-center justify-center px-20 text-center">
<h1 className="text-6xl font-bold"> <h1 className="text-6xl font-bold">
Welcome to{' '} Welcome to{' '}
<a className="text-blue-600" href="https://nextjs.org"> <a className="text-blue-600" href="https://nextjs.org">
...@@ -18,15 +18,15 @@ export default function Home() { ...@@ -18,15 +18,15 @@ export default function Home() {
<p className="mt-3 text-2xl"> <p className="mt-3 text-2xl">
Get started by editing{' '} Get started by editing{' '}
<code className="p-3 font-mono text-lg bg-gray-100 rounded-md"> <code className="rounded-md bg-gray-100 p-3 font-mono text-lg">
pages/index.tsx pages/index.tsx
</code> </code>
</p> </p>
<div className="flex flex-wrap items-center justify-around max-w-4xl mt-6 sm:w-full"> <div className="mt-6 flex max-w-4xl flex-wrap items-center justify-around sm:w-full">
<a <a
href="https://nextjs.org/docs" href="https://nextjs.org/docs"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600" className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
> >
<h3 className="text-2xl font-bold">Documentation &rarr;</h3> <h3 className="text-2xl font-bold">Documentation &rarr;</h3>
<p className="mt-4 text-xl"> <p className="mt-4 text-xl">
...@@ -36,7 +36,7 @@ export default function Home() { ...@@ -36,7 +36,7 @@ export default function Home() {
<a <a
href="https://nextjs.org/learn" href="https://nextjs.org/learn"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600" className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
> >
<h3 className="text-2xl font-bold">Learn &rarr;</h3> <h3 className="text-2xl font-bold">Learn &rarr;</h3>
<p className="mt-4 text-xl"> <p className="mt-4 text-xl">
...@@ -46,7 +46,7 @@ export default function Home() { ...@@ -46,7 +46,7 @@ export default function Home() {
<a <a
href="https://github.com/vercel/next.js/tree/canary/examples" href="https://github.com/vercel/next.js/tree/canary/examples"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600" className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
> >
<h3 className="text-2xl font-bold">Examples &rarr;</h3> <h3 className="text-2xl font-bold">Examples &rarr;</h3>
<p className="mt-4 text-xl"> <p className="mt-4 text-xl">
...@@ -56,7 +56,7 @@ export default function Home() { ...@@ -56,7 +56,7 @@ export default function Home() {
<a <a
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600" className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
> >
<h3 className="text-2xl font-bold">Deploy &rarr;</h3> <h3 className="text-2xl font-bold">Deploy &rarr;</h3>
<p className="mt-4 text-xl"> <p className="mt-4 text-xl">
...@@ -66,7 +66,7 @@ export default function Home() { ...@@ -66,7 +66,7 @@ export default function Home() {
</div> </div>
</main> </main>
<footer className="flex items-center justify-center w-full h-24 border-t"> <footer className="flex h-24 w-full items-center justify-center border-t">
<a <a
className="flex items-center justify-center" className="flex items-center justify-center"
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
...@@ -74,7 +74,7 @@ export default function Home() { ...@@ -74,7 +74,7 @@ export default function Home() {
rel="noopener noreferrer" rel="noopener noreferrer"
> >
Powered by{' '} Powered by{' '}
<img src="/vercel.svg" alt="Vercel Logo" className="h-4 ml-2" /> <img src="/vercel.svg" alt="Vercel Logo" className="ml-2 h-4" />
</a> </a>
</footer> </footer>
</div> </div>
......
module.exports = {
arrowParens: 'always',
singleQuote: true,
tabWidth: 2,
semi: false,
tailwindConfig: './tailwind.config.js',
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment