顺风 CCS 样式未反映在 Svelte 项目 (localhost) 上

tailwind ccs styles not reflecting on the Svelte project (localhost)

提问人:Helmar Bachle 提问时间:1/2/2023 最后编辑:H.B.Helmar Bachle 更新时间:1/2/2023 访问量:692

问:

我已经按照 https://tailwindcss.com/docs/guides/sveltekit 使用 SvelteKit 安装 Tailwind CSS 的说明进行操作,但是样式不会反映在项目中。 收到错误“在规则 @tailwind 中未知enter image description here

import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  kit: {
    adapter: adapter()
  },
  preprocess: vitePreprocess()
};

export default config;
语法错误 tailwind-css svelte

评论

1赞 Laaouatni Anas 1/2/2023
是正常的...即使这样也应该可以正常工作。我使用 svelteKit 和 Tailwind 创建了 5+ 个项目,它对该警告没有任何问题。如果它有效,请不要对 CSS 文件中的代码收费。对于经验是 VSCode 警告。如果需要,可以停用它
0赞 Helmar Bachle 1/2/2023
/** @type {import('tailwindcss').Config} / module.exports = { content: ['./src/**/.{html,js,svelte,ts}'], theme: { extend: {} }, plugins: [] };这个tailwind.config.cjs文件是否正确
0赞 Helmar Bachle 1/2/2023
我现在已在app.html文件中添加了链接,它终于可以工作了。
0赞 Helmar Bachle 1/2/2023
<script src=“cdn.tailwindcss.com”></script>

答: 暂无答案