Mat Blazor mat-expansion-panel remove elevation/border

为君一笑 提交于 2020-02-16 06:29:20

问题


I want to remove the elevation/border from Mat expansion panel.

I've already read other related articles like mat-expansion-panel remove border but they are not working within Blazor.

I've tried to access the background-color property but MatBlazor is saying this property doesnt exist.

I've also tried using the class=".mat-elevation-z0" inside the Mat Expansion panel like this:

<MatExpansionPanel class=".mat-elevation-z0" @bind-Expanded="@panelOpenState">

Which Doesn't work.

At the minute the code looks like this:

<MatAccordion>
      <MatExpansionPanel>
          <MatExpansionPanelSummary>
              <MatExpansionPanelHeader>
                Personal data
              </MatExpansionPanelHeader>
              <MatExpansionPanelSubHeader>
                Type your name and age
              </MatExpansionPanelSubHeader>
          </MatExpansionPanelSummary>
        <MatExpansionPanelDetails>
              <MatTextField Label="First name"></MatTextField>
              <MatTextField Label="Age"></MatTextField>
          </MatExpansionPanelDetails>
      </MatExpansionPanel>
 </MatAccordion>

This makes a matblazor expansion panel appear on the page but with a shadow/elevation/border round it. i can't seem to get that to dissappear. I'm wondering if it is a specific blazor issue - as others using the matt expansion panel (with javascript, etc) seem to have work arounds?


回答1:


Just override box-shadow css through Style parm:

<MatExpansionPanel Style="box-shadow: none;">

Try it at blazorfiddle.com



来源:https://stackoverflow.com/questions/57295435/mat-blazor-mat-expansion-panel-remove-elevation-border

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!