更改 Office UI Fabric React 组件的颜色
Changing the color of Office UI Fabric React components
我正在 React 应用程序中制作一个 Office Fabric 面板,用作创建、更新和删除实体的表单。问题是在删除面板上我希望主按钮是红色而不是 Fabric 的标准蓝色。
如果可能的话,我相信这很容易,但是由于我在HTML/CSS/JS方面没有经验,我不知道该怎么做,想要一个使用内联的解决方案CSS.我想它看起来像这样:
<PrimaryButton onClick={ this._onDelete } style={{marginRight: '8px', backgroundColor:'alert', color: 'white'}} >Delete</PrimaryButton>
MS's documentation doesn't help me a lot, I don't know what to import. and my good friend Google hasn't done the trick this time. I have found some answers that are close, but is for overriding the theme of all components and another 没有告诉我要导入什么(我想这是我缺少的部分)。
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
那么您可以使用以下方法:
<DefaultButton
style={{backgroundColor:'black', color:'white'}}
text='Accept'
/>
就这么简单:)
我正在 React 应用程序中制作一个 Office Fabric 面板,用作创建、更新和删除实体的表单。问题是在删除面板上我希望主按钮是红色而不是 Fabric 的标准蓝色。
如果可能的话,我相信这很容易,但是由于我在HTML/CSS/JS方面没有经验,我不知道该怎么做,想要一个使用内联的解决方案CSS.我想它看起来像这样:
<PrimaryButton onClick={ this._onDelete } style={{marginRight: '8px', backgroundColor:'alert', color: 'white'}} >Delete</PrimaryButton>
MS's documentation doesn't help me a lot, I don't know what to import. and my good friend Google hasn't done the trick this time. I have found some answers that are close, but
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
那么您可以使用以下方法:
<DefaultButton
style={{backgroundColor:'black', color:'white'}}
text='Accept'
/>
就这么简单:)