如何更改包装React组件的Web组件的样式

发布于 2025-02-09 07:48:48 字数 658 浏览 2 评论 0原文

我有一个围绕React组件的Web组件。我想更改边界半径的反应组件中有一些div。这是base.tsx中的代码

export abstract class Base extends BaseReactElement {
    static get styles() {
        return [
            unsafeCSS(processCssText(reactStyles)),
            unsafeCSS(processCssText(styles)),
            css`
                :host,
                :host > div,
                :host > div > div {
                    display: block;
                    width: 100%;
                }

              #test {
                border-radius: var(--test-border-radius, 0);
              }

。我有Web组件,可以调用围绕base.tsx React组件。调用HS-DIAGOG时,如何更改测试仪 - radius的价值?

I have a web component that wraps around a react component. There are some divs in the react component that I want to change the border radius of. Here's the code in Base.tsx

export abstract class Base extends BaseReactElement {
    static get styles() {
        return [
            unsafeCSS(processCssText(reactStyles)),
            unsafeCSS(processCssText(styles)),
            css`
                :host,
                :host > div,
                :host > div > div {
                    display: block;
                    width: 100%;
                }

              #test {
                border-radius: var(--test-border-radius, 0);
              }

I want to change the value of test-border-radius. I have web component that calls which is wraps around Base.tsx React component. How can I change the value of test-border-radius when calling hs-dialog?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文