aiamjay
V2EX  ›  问与答

求助 tailwind 和 emotion 同时使用的问题

  •  
  •   aiamjay · Jul 10, 2023 · 827 views
    This topic created in 1038 days ago, the information mentioned may be changed or developed.

    大家好,求助一个 React 的问题。 我在自定义 Component 的时候,使用 emotion styled 定义组件样式;组件同时接受外部传入的 classname ,来修改默认样式;但是我很快发现,最为参数传入的 classname ( tailwind 样式) 并不能覆盖 styled 定义的默认样式;所以,我想请教一个问题,同时使用 emotion 和 tailwind 的时候,该如何指定样式的顺序? 另外,请教另一个问题,业内目前主流的 React CSS 方案是什么? 十分感谢🙏

    1 replies    2023-07-10 17:21:13 +08:00
    linkopeneyes
        1
    linkopeneyes  
       Jul 10, 2023
    如果你想让 tailwind 的 class 优先级更高可以加个叹号
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2794 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:44 · PVG 23:44 · LAX 08:44 · JFK 11:44
    ♥ Do have faith in what you're doing.