Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用Attributify Mode时,bg-[var(--red-1)]不生效。 #48

Closed
HuangYaobin opened this issue Mar 30, 2023 · 3 comments
Closed

使用Attributify Mode时,bg-[var(--red-1)]不生效。 #48

HuangYaobin opened this issue Mar 30, 2023 · 3 comments

Comments

@HuangYaobin
Copy link

image

image

@MellowCo
Copy link
Owner

因为 Attributify Mode 里不支持匹配 [],可以改为 xx="[xxx]" 性质

<div style="--red-1: red">
  <div class="flex-1" bg-[#ccc] text-center>text</div>
  <div class="flex-1 mt-4" bg="[#aaa]"  text-center>text</div>
  
  <div class="flex-1 mt-4" bg-[var(--red-1)] text-center>text</div>
  <div class="flex-1 mt-4" bg="[var(--red-1)]" text-center>text</div>
</div>

play

image

@MellowCo
Copy link
Owner

有这方面需求,可以在 unocss 提个issues

@HuangYaobin
Copy link
Author

感谢解答! text=这种方式也够用了

@MellowCo MellowCo closed this as completed Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants