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

开发环境和生产环境生成的样式优先级不一致 #1978

Open
izhaoqing opened this issue Dec 9, 2022 · 1 comment
Open

开发环境和生产环境生成的样式优先级不一致 #1978

izhaoqing opened this issue Dec 9, 2022 · 1 comment
Labels

Comments

@izhaoqing
Copy link

在 vite 项目中,开发环境和生产环境生成的 class 顺序不一致,导致两种环境下出现不同的效果。

demo: https://github.com/izhaoqing/unocss-demo

pnpm i
pnpm dev
pnpm preview:build

生产环境:
image

开发环境:
image

@sibbng
Copy link
Member

sibbng commented Dec 9, 2022

Temporarily you can fix that by adding mergeSelectors: false in your config.

Another issue related to mergeSelectors: #1967. Both will be fixed by #1973.

Note that: when #1973 is merged, text-#333 will have higher precedence. It's better to avoid using utilities that apply the same CSS properties at the same time.

@stale stale bot added the stale label Feb 8, 2023
@sibbng sibbng removed the stale label Feb 8, 2023
@stale stale bot added the stale label Apr 9, 2023
@sibbng sibbng added no stale and removed stale labels Apr 9, 2023
@unocss unocss deleted a comment from stale bot Apr 9, 2023
@unocss unocss deleted a comment from stale bot Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants