1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Next.jsでのtailwindcssの導入の仕方

Posted at

#流行りのスタイルのtailwindcssの導入の仕方(Next.js)

npx create-next-app next-jsで導入したファイルに

1.npm install

npx create-next-app . --use-npm

npm i tailwindcss

npx tailwindcss init -p

2.🗂stylesのglobal.cssの中身を書き換える

@tailwind base;
@tailwind components;
@tailwind utilities;

3.🗂pagesにimport文を追加

import '../styles/globals.css';
import 'tailwindcss/tailwind.css';

4.下記のサイトを参考にclassName内に記述

tailwindcssのチートシート

[例です]
<div classnName="flex justify-center items-center flex-col min-h-screen text-gray-600 text-sm font-mono"></div> 
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?