mokevip

tailwindcss 怎么覆盖样式

  •  
  •   mokevip ·
    moke8 · Jul 25, 2022 · 3949 views
    This topic created in 1387 days ago, the information mentioned may be changed or developed.

    当两个类的样式冲突时,怎么让某个类的权重提升,类似于!important ,因为大家权重都一样,谁覆盖谁也说不清,就很难受

    5 replies    2022-07-25 13:32:40 +08:00
    shyling
        1
    shyling  
       Jul 25, 2022
    这东西的设计不应该原子化吗。
    按理来说不应该重复写一类样式吧。
    你不会先写个 w-2 再写个 w-4 吧。
    mokevip
        2
    mokevip  
    OP
       Jul 25, 2022
    @shyling 自定义了样式 .label width 24 但是当下场景需要覆盖为 w-40
    mokevip
        3
    mokevip  
    OP
       Jul 25, 2022
    不然需要在页面里写样式,用 tailwind 就不太想专门写样式了 (笑哭)
    mxnore
        4
    mxnore  
       Jul 25, 2022
    mokevip
        5
    mokevip  
    OP
       Jul 25, 2022
    @mxnore 谢谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5961 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 03:09 · PVG 11:09 · LAX 20:09 · JFK 23:09
    ♥ Do have faith in what you're doing.