无法弄清楚如何从导入的组件中删除填充

发布于 2025-01-11 14:25:59 字数 1264 浏览 0 评论 0原文

所以我正在使用 smui-accordion 组件,我只是不知道如何删除它填充! 我尝试过在所有地方都填充零,但无济于事...... 填充痛苦

<Accordion style="padding: 0">
<Panel  style="padding: 0" bind:open={reviewAccordion} variant="unelevated">
    <Header  style="padding: 0">
        <h3 style="padding: 0"class="mva">Reviews ({reviews_list.length})</h3>
        <div style="padding: 0" class="flex1"></div>
        <div class="mva" style="padding: 0; height: 20px;"><StarRating rating={rating} config={star_config}/></div>
        <IconButton style="padding: 0" slot="icon" toggle pressed={reviewAccordion}>
            <Icon class="material-icons" on>expand_less</Icon>
            <Icon class="material-icons">expand_more</Icon>
        </IconButton>
    </Header>
    <Content  style="padding: 0">
        {#each reviews_list as review, i}
            <div style="padding: 0"><Review review={review}/></div>
        {/each}
    </Content>
</Panel>

So I'm using the smui-accordion component and I just can't figure out how to remove it's padding!
I've tried putting everywhere zero padding but to no avail...
Padding suffering

<Accordion style="padding: 0">
<Panel  style="padding: 0" bind:open={reviewAccordion} variant="unelevated">
    <Header  style="padding: 0">
        <h3 style="padding: 0"class="mva">Reviews ({reviews_list.length})</h3>
        <div style="padding: 0" class="flex1"></div>
        <div class="mva" style="padding: 0; height: 20px;"><StarRating rating={rating} config={star_config}/></div>
        <IconButton style="padding: 0" slot="icon" toggle pressed={reviewAccordion}>
            <Icon class="material-icons" on>expand_less</Icon>
            <Icon class="material-icons">expand_more</Icon>
        </IconButton>
    </Header>
    <Content  style="padding: 0">
        {#each reviews_list as review, i}
            <div style="padding: 0"><Review review={review}/></div>
        {/each}
    </Content>
</Panel>

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

_失温 2025-01-18 14:25:59

您可以将类添加到所有 SMUI 组件,这样您就可以执行以下操作:

<Accordion class="myclass" />

您只需记住的就是将这些类标记为全局类。
您可能会使用一些实用程序类将填充设置为 0,因此这不是什么大问题。

You can plasses classes to all SMUI components, so you can do something like:

<Accordion class="myclass" />

All you have to remember is to mark those classes as global.
You would probably use some utility class for setting padding to 0, so this is not so much of a problem.

魔法少女 2025-01-18 14:25:59

您是否尝试过使用“!important”css 语句?

style="padding: 0 !important"

Have you tried to use "!important" css statement?

style="padding: 0 !important"
盛夏已如深秋| 2025-01-18 14:25:59

无需添加所有内联内容,只需在上面添加一个 css 标签:

.smui-accordion .smui-accordion__panel > .smui-accordion__header .smui-accordion__header__title {padding: 0}

上面只是手风琴 css 控制台上的内容...这将覆盖第三方 css,您可以控制它。

Instead of adding all those inline just add a css tag above:

.smui-accordion .smui-accordion__panel > .smui-accordion__header .smui-accordion__header__title {padding: 0}

Above is just whats on console from the accordion css...This will overwrite the third party css and you can have control over it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文