Home
Sign Up
Sign In
V2EX
›
前端开发
tailwindcss 怎么覆盖样式
mokevip
·
moke8
·
Jul 25, 2022
· 4495 views
This topic created in 1571 days ago, the information mentioned may be changed or developed.
当两个类的样式冲突时,怎么让某个类的权重提升,类似于!important ,因为大家权重都一样,谁覆盖谁也说不清,就很难受
权重
样式
覆盖
important
5 replies
•
2022-07-25 13:32:40 +08:00
shyling
Jul 25, 2022
1
这东西的设计不应该原子化吗。
按理来说不应该重复写一类样式吧。
你不会先写个 w-2 再写个 w-4 吧。
mokevip
OP
Jul 25, 2022
2
@
shyling
自定义了样式 .label width 24 但是当下场景需要覆盖为 w-40
mokevip
OP
Jul 25, 2022
3
不然需要在页面里写样式,用 tailwind 就不太想专门写样式了 (笑哭)
mxnore
Jul 25, 2022
4
前面加个叹号就行
https://tailwindcss.com/docs/configuration#important-modifier
mokevip
OP
Jul 25, 2022
5
@
mxnore
谢谢!
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
4273 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 09:15
·
PVG 17:15
·
LAX 01:15
·
JFK 04:15
♥ Do have faith in what you're doing.
❯