0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Next.js/TailwindCSS】layout.tsx にCSSファイルをインポートする | Next.js Tutorial #2 - CSS Styling

Posted at

概要

  • 公式が公開しているサンプルコードをインストールすると、レイアウトが崩壊している。
  • 公式の指示に従って、@importするとレイアウトを反映させることが出来る。

やること

  • 次のファイルを開く [app]>[layout.tsx]
  • 1行目に次のコードを追加する
+ import '@/app/ui/global.css';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}
  • 自動リロードでlocalhost:3000は更新されていることを確認する。(Globalの人はIPのURLを参照)

参考

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?