bytedance / xgplayer

A HTML5 video player with a parser that saves traffic
https://h5player.bytedance.com/
MIT License
7.99k stars 843 forks source link

去除默认的全局样式,使用更为精细化的方式实现 #1499

Open Nakus0426 opened 2 weeks ago

Nakus0426 commented 2 weeks ago

您使用的西瓜播放器版本是多少? What version of xgplayer are you using? 3.0.18

您使用的操作系统和浏览器分别是? What OS and browser are you using? 操作系统:windows 11 23H2 22631.3737 浏览器 Microsoft Edge 125.0.2535.92

如何复现问题? How to reproduce the problem? 在播放器的容器内插入任意元素,并给这个元素设置样式,观察其样式的优先级 image

https://stackblitz.com/edit/stackblitz-starters-2khfew?file=index.html

您期望的播放器正常行为是? What did you expect to happen? 播放器容器内的自定义元素的样式不应该被播放器的全局样式覆盖

实际播放器的表现是? What actually happened? 播放器容器内的自定义元素的样式会被播放器的全局样式覆盖

可填写您所在的公司和相关产品业务,方便我们提供更好的技术支持 You can write your company and product which uses xgplayer, for helping us provide better technical support.

gemxx commented 2 weeks ago

@Nakus0426 这个基础样式调整影响很大,暂无法修改。能否通过提高custom css优先级处理?

.xgplayer .custom {}

Nakus0426 commented 2 weeks ago

@Nakus0426 这个基础样式调整影响很大,暂无法修改。能否通过提高custom css优先级处理?

.xgplayer .custom {}

理论上可行,但这块最好还是不要出现 * 这种选择器,希望后续能进行修改吧