你可以将 Tailwind 与普通 CSS 混合使用吗?

ac *_*des 11 tailwind-css

我对 Tailwind 非常陌生,希望将其合并到现有的 React 项目中。我可以将 Tailwind 与我当前的所有 CSS/sass 文件一起使用吗?或者我是否需要从头开始设计并且只使用 Tailwind?

Dav*_*ies 11

确保您当前的 CSS 不会被覆盖。您可以添加前缀tailwind.config.js

示例:(来源:tailwind.com)

// tailwind.config.js
module.exports = {
   prefix: 'tw-',
}
Run Code Online (Sandbox Code Playgroud)

.tw-将生成带有如下前缀的类.tw-{class}

.tw-text-left {
    text-align: left;
}
.tw-text-center {
    text-align: center;
}
.tw-text-right {
    text-align: right;
}
/* etc. */
Run Code Online (Sandbox Code Playgroud)