小编und*_*ack的帖子

在 Next.js 应用程序中安装 Tailwind css 后,MDX 样式 (next-mdx-remote) 失败

我正在使用next-mdx-remote在 Next.js 项目中使用 MDX。

我一直在遵循 JetBrains WebStorm指南来构建这个,这里他们使用 bootstrap 作为 CSS,但我选择的 CSS 框架是 tailwind css。

问题是,当我安装 tailwind css 或任何其他基于 tailwind css(如flowbite )的 CSS 时,MDX 页面会丢失其样式。

添加顺风后我期望得到什么

  • tailwind.config.js
module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};

Run Code Online (Sandbox Code Playgroud)
  • _app.tsx

import "../styles/globals.css";
import type { AppProps } from "next/app";
import Head from "next/head";
import Script from "next/script";
import Nav from "../components/Nav";

function MyApp({ Component, pageProps }: AppProps) {
  return ( …
Run Code Online (Sandbox Code Playgroud)

css typescript next.js tailwind-css mdxjs

5
推荐指数
1
解决办法
1490
查看次数

标签 统计

css ×1

mdxjs ×1

next.js ×1

tailwind-css ×1

typescript ×1