unocss icon indicating copy to clipboard operation
unocss copied to clipboard

unocss style repeated loading

Open mojiefong opened this issue 1 year ago • 4 comments

UnoCSS version

0.62.2

Describe the bug

image

Using unocss style will load multiple times.

At first I thought it was due to element plus, but the problem still exists after commenting it out

There are problems in Chrome and Edge, but Firefox seems to be normal

Reproduction

https://github.com/mojiefong/my-vue-app

System Info

macOS

pnpm v9.7.0 nodejs v20.10.0

Validations

mojiefong avatar Aug 16 '24 02:08 mojiefong

太影响样式调试了,期待解决

LiYuzZ avatar Aug 22 '24 09:08 LiYuzZ

How do you trigger that behavior? I couldn't reproduce with your reproduction

antfu avatar Aug 22 '24 18:08 antfu

How do you trigger that behavior? I couldn't reproduce with your reproduction

Hmm? Can't my repository be reproduced?

Open the debug mode, select the div element and scroll down to see it

Actually, my demo is very simple, I just use vite to initialize the project and then install unocss

I uploaded a gif, you can take a look:

20240823-100235

mojiefong avatar Aug 23 '24 02:08 mojiefong

This is not kind of repeat. The repeat you called is just the same global styles inherited from its parent and its acestors, and it is expected to be overrided since the element itselt also applys the global styles. You can see in the style panel that all styles with line-through are listed in its own group, such as body

image

zoeyzhao19 avatar Aug 25 '24 12:08 zoeyzhao19

This is not kind of repeat. The repeat you called is just the same global styles inherited from its parent and its acestors, and it is expected to be overrided since the element itselt also applys the global styles. You can see in the style panel that all styles with line-through are listed in its own group, such as body

image

@zoeyzhao19 So how to optimize this? It affects the debugging of the style a bit.

mojiefong avatar Sep 03 '24 02:09 mojiefong

It is currently consistent with tailwind, so I think it should be reasonable

Simon-He95 avatar Sep 06 '24 08:09 Simon-He95