-
Notifications
You must be signed in to change notification settings - Fork 6
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
自定义组件样式重复,element-plus组件样式上升到页面head标签里 #33
Comments
Hi @dsmelon, if you could write in a language that I can understand( German / English ), I would be happy to tackle this issue |
The issue you experience might be due to a bug in an older version of the example of element plus. |
After the version is changed, the problem of repeated insertion of the element-plus component style is solved. However, the following two problems still exist:
|
This is the current design of that plugin, to create a style tag for every component style section, and if there are shared styles between the components that can be injected to the top of the Shadow DOM with the option of
Currently, if the components are unmount the style tag will also be removed
If I recall correctly, this is because 'element plus' is passing the style as a css variable which can penetrate the Shadow Dom, Please let me know if you have any other suggestions for improvements, or you are very welcome to open a PR |
You misunderstood my first question. |
自定义组件的样式不应该紧跟着组件插入style标签,应该汇总去重后插入当前shadow-root下,当组件全部卸载时,再清除样式。
element-plus的列子,组件样式上升到了页面的head标签里,会污染主程序样式,而且组件越多,样式重复越多,例子里就能复现。
The text was updated successfully, but these errors were encountered: