简体   繁体   English

Coveo 原子搜索界面样式 - Atomic-Icon - Shadow Dom

[英]Coveo Atomic Search Interface Styling - Atomic-Icon - Shadow Dom

I am trying to style Coveo's new Atomic React Wrapper using Shadow Dom.我正在尝试使用 Shadow Dom 设计 Coveo 的新 Atomic React Wrapper。 It doesn't appear they exposed the atomic-icon's svg elements as a part for both submit-button and clear-button.他们似乎没有将 atomic-icon 的 svg 元素暴露为提交按钮和清除按钮的一部分。 I was able to modify their colors by changing some of the variables.我能够通过更改一些变量来修改它们的颜色。

atomic-search-box::part(clear-button){ width: 50px; height: 50px; }

This will affect the background of the svg but not the icon itself.这将影响 svg 的背景,但不会影响图标本身。 Here is the rendered html of clear-button.这是清除按钮的渲染html。

 <button class="btn-text-transparent w-8 h-8 mr-1.5 text-neutral-dark ripple-parent ripple-relative" part="clear-button" aria-label="Clear"><atomic-icon class="w-3 h-3 hydrated ripple-relative" innerhtml="<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 18 18&quot;><path d=&quot;m18 2-1.8-2-7.1 7.1-7.1-7.1-2 2 7.1 7.1-7.1 7.1 2 1.8 7.1-6.9 7.1 6.9 1.8-1.8-6.9-7.1z&quot;></path></svg>"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><path d="m18 2-1.8-2-7.1 7.1-7.1-7.1-2 2 7.1 7.1-7.1 7.1 2 1.8 7.1-6.9 7.1 6.9 1.8-1.8-6.9-7.1z"></path></svg></atomic-icon></button>

it looks like height and width are pulled from .w-3 .h-3 classes on the atomic-icon.看起来高度和宽度是从原子图标上的 .w-3 .h-3 类中提取的。

.h-3 {
    height: 0.75rem;
}

Can I override those classes somehow or how would you increase the size of these elements?我可以以某种方式覆盖这些类,或者您将如何增加这些元素的大小?

At the time when you asked your question, there was indeed no easy way to edit those components.在您提出问题时,确实没有简单的方法来编辑这些组件。 However, within the last weeks, the clear-icon and submit-icon shadow parts have been released: https://docs.coveo.com/en/atomic/latest/reference/components/atomic-search-box/ I hope this helps!但是,在过去几周内,clear-icon 和 submit-icon 阴影部分已经发布: https ://docs.coveo.com/en/atomic/latest/reference/components/atomic-search-box/ 我希望这个有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM