英文:
How to disable or purge non-class types in tailwindcss
问题
在我的项目中,我想在 PHP 中运行一个 Svelte 捆绑(使用 Rollup),并使用 Tailwind CSS 来配置该捆绑的类。
问题是,我不知道 Tailwind 做了很多元素选择器样式(例如 body、h1、table 等),而 PHP 项目已经有了默认选择器样式的 CSS 文件,我打算使用它们。
有没有办法忽略 Tailwind CSS 中的所有选择器样式,或者让它在捆绑中隔离(捆绑正在加载到一个 div 中)?
英文:
So on my project, I want to run a svelte bundle (using rollup) inside a PHP and use tailwindcss to configure the classes of that bundle.
The problem is that I didn't know tailwind does a lot of element selector styling (body, h1, table etc.) and the PHP project already has css files that has default selector style that I plan to use.
Is their a way to ignore all of the selector style in tailwindcss or a way to make it isolated within the bundle (the bundle is being loaded inside a div)
答案1
得分: 1
元素选择器规则来自Tailwind的preflight核心插件。根据文档的说明,您可以像禁用其他核心插件一样,在tailwind.config.js
中禁用它:
module.exports = {
corePlugins: {
preflight: false,
}
}
英文:
The element selector rules are from Tailwind's preflight core plugin. As per the documentation, you can disable it like any other core plugin, in tailwind.config.js
:
module.exports = {
corePlugins: {
preflight: false,
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论