Css Ionic 5-更改Safari/iOS中位于#shadow root下的Ionic range中.range滑块的样式
我需要更改.range slider类的样式以创建更大的触摸区域,但由于它位于#shadow root下,所以我唯一能做的就是使用Css Ionic 5-更改Safari/iOS中位于#shadow root下的Ionic range中.range滑块的样式,css,safari,mobile-safari,shadow-dom,ionic5,Css,Safari,Mobile Safari,Shadow Dom,Ionic5,我需要更改.range slider类的样式以创建更大的触摸区域,但由于它位于#shadow root下,所以我唯一能做的就是使用 const customStyleElement = document.createElement('style'); customStyleElement.innerHTML = `.range-slider { height: 200px !important; top: 97px; }`); rangeRef.current.shadowRoot
const customStyleElement = document.createElement('style');
customStyleElement.innerHTML = `.range-slider {
height: 200px !important;
top: 97px;
}`);
rangeRef.current.shadowRoot.appendChild(customStyleElement);
这在Chrome上运行良好,但在Safari或移动iOS上不起作用
Safari阴影内容示例
欢迎来到StackOverflow!处理阴影Dom有时会非常混乱。你介意在你的项目中添加离子范围的截图吗?这样就更容易知道预期的最终结果是什么,并了解如何实现。谢谢!:)欢迎来到StackOverflow!处理阴影Dom有时会非常混乱。你介意在你的项目中添加离子范围的截图吗?这样就更容易知道预期的最终结果是什么,并了解如何实现。谢谢!:)