如何在 React 项目中一起使用 Antdesign 和 tailwindcss [英] How to use Antdesign with tailwindcss together in a React Project

查看:446
本文介绍了如何在 React 项目中一起使用 Antdesign 和 tailwindcss的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建立一个新项目,想把这两个包放在一起但不确定,所以问题是使用 Tailwindcss 和 antdesign 是一个好习惯吗?

I'm going to set up a new project and would like to have these two packages together but not sure, so the question is that using Tailwindcss with antdesign Is a good practice?

有人有经验吗?

每个包都有自己的主题管理器,例如适用于所有颜色、排版、暗模式等.您如何管理主题,使用顺风或 antd 或两者兼而有之?为什么?

Each package has its own theme manager for instances for all colors, typography, dark mode and etc. how do you manage the theme, with tailwinds or antd or both? and why?

这两个软件包都具有 Grid 功能,您更喜欢哪一个?

Both packages have the ability for Grid, which one would be you prefer?

让我们谈谈您的见解?

经过一番研究,我发现了这些结果

After some research, I found these results

使用两个库的一些示例:

Some examples that used both libs:

https://github.com/plamworapot/next-antd-tailwindcss

https://github.com/dospolov/react-redux-saga-antd-tailwind-boilerplate

https://github.com/cunhamuril/pocs

建议尝试只提交一个框架

It recommended trying to commit to only one framework

推荐答案

你可以在 ant design 中使用 Bootstrap 吧?认为 Tailwind 与 Bootstrap 相同.Tailwind 是一个 CSS 库,您可以将它与任何设置和框架一起使用,无需额外配置.只需传递 Tailwind 类名称即可.

You can use Bootstrap with ant design right? Think Tailwind same as Bootstrap. Tailwind is a CSS library you can use it with any setup and framework there no extra configurations needed. Just pass the Tailwind class names.

说到主题.这是一个上下文.Ant 设计将抓住它的上下文,顺风抓住它.我们不需要考虑或担心

When it comes to theming. It's a context. Ant design will grab it's context and tailwind grab it's. We don't need to think or worry about it

这篇关于如何在 React 项目中一起使用 Antdesign 和 tailwindcss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆