html 如何禁用antd css-dev-only样式

yhived7q  于 7个月前  发布在  其他
关注(0)|答案(1)|浏览(651)

我有一个带有tailwindantdnextjs项目。当我使用antd布局组件时,会应用此样式,我无法删除它。

:where(.css-dev-only-do-not-override-12upa3x).ant-layout-header

字符串
它来自head的风格脚本:

<style data-rc-order="prependQueue" data-css-hash="twrzxg" data-token-hash="vx5xn4" data-dev-cache-path="vx5xn4|Shared|ant">:where(.css-dev-only-do-not-override-12upa3x) a{color:#1677ff;text-decoration:none;background-color:transparent;outline:none;cursor:pointer;transition:color 0.3s;-webkit-text-decoration-skip:objects;}:where(.css-dev-only-do-not-override-12upa3x) a:hover{color:#69b1ff;}:where(.css-dev-only-do-not-override-12upa3x) a:active{color:#0958d9;}:where(.css-dev-only-do-not-override-12upa3x) a:active,:where(.css-dev-only-do-not-override-12upa3x) a:hover{text-decoration:none;outline:0;}:where(.css-dev-only-do-not-override-12upa3x) a:focus{text-decoration:none;outline:0;}:where(.css-dev-only-do-not-override-12upa3x) a[disabled]{color:rgba(0, 0, 0, 0.25);cursor:not-allowed;}</style>


我怎么才能摆脱这个?

pvabu6sv

pvabu6sv1#

你将需要使用<StyleProvider>as outlined here。我花了一些时间让它与我使用的来自ant design的 single 组件一起工作,这是我最终想到的:

import { StyleProvider } from '@ant-design/cssinjs';
...
<StyleProvider hashPriority="high"><TimePicker /></StyleProvider>

字符串
根据我的经验,StyleProvider必须是组件中的根元素。

相关问题