简体   繁体   English

Tailwind 配置未导出所有 CSS

[英]Tailwind config not exporting all css

I am trying to publish the full tailwind 3.0 css library in a fresh laravel 8.* project with the view to use the corePlugins section to remove what I do not need.我正在尝试在新的 laravel 8.* 项目中发布完整的 tailwind 3.0 css 库,以使用corePlugins部分删除我不需要的内容。 The thing is although the setup was quick, I can not get the complete tailwind css styles published in the public app.css file;问题是虽然设置很快,但我无法在公共app.css文件中发布完整的顺风 css 样式; only the base styles get published.仅发布基本样式。 So what am I doing wrong?那么我做错了什么?

I started with npm to install :我从npm开始安装:
install -D tailwindcss postcss autoprefixer . install -D tailwindcss postcss autoprefixer

2] Then, I setup mix : 2]然后,我设置mix

.postCss('resources/css/app.css', 'public/css', [
        require("tailwindcss"),
        require("autoprefixer"),
    ]);

3] Then, I setup layers in the ./resource/css/app.css file: 3] 然后,我在./resource/css/app.css文件中设置图层:

@import "~tailwindcss/base";
@import "~tailwindcss/components";
@import "~tailwindcss/utilities";

4] Then, I added the full tailwind config in tailwind.config.js as stated on the box : npx tailwindcss init --full 4]然后,我在tailwind.config.js中添加了完整的tailwind.config.js配置, 如包装盒上所述npx tailwindcss init --full
Finally , I ran the command npm run dev to publish all styles in the public app.css file.最后,我运行命令npm run dev在公共app.css文件中发布所有样式。 But only the base styles was present in the public app.css file.但是公共app.css文件中只存在基本样式。

I am looking for a quick way to sample styles and remove the unnecessary bits.我正在寻找一种快速采样样式并删除不必要位的方法。 Can someone please assist?有人可以帮忙吗?

There is no concept of a "full tailwind 3.0 css library" like in previous versions, as combining all the variations available in version 3 would be too large.没有像以前版本那样的“完整的 tailwind 3.0 css 库”的概念,因为结合版本 3 中可用的所有变体会太大。 This is explained here, https://tailwindcss.com/blog/tailwindcss-v3#just-in-time-all-the-time这在这里解释, https://tailwindcss.com/blog/tailwindcss-v3#just-in-time-all-the-time

So it is compulsory to configure the purge settings, which is now called content in tailwind.config.js .因此必须配置清除设置,现在在tailwind.config.js中称为content

So by default, if Tailwind does not find any styles to add to the output, then all it will output is the base files, which is what it sounds like it is currently doing for you.因此,默认情况下,如果 Tailwind 没有找到要添加到输出的任何样式,那么它将输出的只是基本文件,这听起来就像它目前正在为您做的一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM