TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Stop using Tailwind's utility classes in the HTML class attribute

3 点作者 firstrowraver10 个月前

3 条评论

langcss10 个月前
You want to avoid duplication, usually. You can also do it by creating components in React (and other frameworks). Doing so keeps the style close to the component definition which I think is good: if your component is say a nav bar some of its appearance comes from how you nest flexboxes and some from the flexbox configuration. Why not keep that all together?
throwaway4good10 个月前
Isn't this the very point of tailwind? If you don't like it maybe just don't use tailwind.
ragnarel10 个月前
So what is the point of using Tailwind if you do not want to use its main feature?