Я сделал свой файл tailwind.config.js .
Код: Выделить всё
/** @type {import('tailwindcss').Config} */
module.exports = {
//...
content: ['./pages/**/*.{js,ts,jsx,tsx}'],
plugins: [require("daisyui")],
daisyui: {
themes: true
}
}
< /code>
true
Код: Выделить всё
import '../styles/globals.css'
import type { AppProps } from 'next/app'
function MyApp({ Component, pageProps }: AppProps) {
return (
)
}
export default MyApp
< /code>
I also made a postcss.config.js file
module.exports = {
plugins: ['tailwindcss', 'autoprefixer'],
};
< /code>
And I imported
@tailwind base;
@tailwind components;
@tailwind utilities;
< /code>
at the top of globals.css.
This fails because the resulting webpage is just plain white.
[img]https://i.sstatic.net/vA6Y3.jpg[/img]
But what's weird is when I change daisyui: { themes: true }
< /p>
Я предполагаю, что это работает, потому что он переопределяет все стили на каждой странице, и я не хочу. Я хочу иметь возможность объявлять разные темы на любой странице, если я хочу. Итак, как мне правильно установить тему для всего приложения таким образом, чтобы я мог переопределить ее на отдельных страницах, если я хочу?
Подробнее здесь: https://stackoverflow.com/questions/739 ... ext-js-app