0

我将顺风从 v2 更新到 v3,现在缺少一些类。我试图重新安装 tailwind 及其依赖项,但没有帮助。是什么导致了这种奇怪的行为?

例子:

w-6/12
w-7/12 <- does not exist
w-8/12
w-9/12
w-10/12
w-11/12 <- does not exist
w-12/12 <- does not exist

以及来自网格、字体大小等的其他类。

版本

tailwindcss: 3.0.15
tailwindcss/aspect-ratio: 0.4.0
tailwindcss/forms: 0.4.0
tailwindcss/line-clamp: 0.3.1
tailwindcss/typography: 0.5.0

tailwind.config.js

const defaultTheme = require("tailwindcss/defaultTheme");
module.exports = {
    content: [
        './storage/framework/views/*.php',
        './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
        './vendor/laravel/jetstream/**/*.blade.php',
        './resources/views/**/*.blade.php',
    ],

    prefix: 'tw-',

    theme: {
        extend: {
            fontFamily: {
                sans: ['Nunito', ...defaultTheme.fontFamily.sans],
            },
        },
        backgroundColor: theme => ({
            ...theme('colors'),
            'header': '#ffffff',
            'main': '#f2f2f3',
            'content': '#ffffff'
        }),

        textColor: theme => ({
            ...theme('colors'),
            'main': '#333333'
        })
    },

    plugins: [require('@tailwindcss/forms'), require('@tailwindcss/typography')],
}

webpack.mix.js

const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .postCss("resources/css/app.css", "public/css", [
        require("tailwindcss")])
    .sass('resources/sass/app.scss', 'public/css')
    .sourceMaps();

resources/css/app.css

@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
4

1 回答 1

0

解决了这个伪问题。

问题是我不太了解更改purge为的新内容content,现在每当我更改样式时我都必须编译它们。另外,之前版本的phpstorm没有看到类,也因此没有给出提示。

于 2022-01-30T12:10:33.117 回答