我不明白为什么我们需要这样做来简化 10px:
html {
font-size: 62.5%; /* 62.5% of 16px = 10px */
}
Run Code Online (Sandbox Code Playgroud)
下面的代码不应该完成所有的工作吗?
const theme = createMuiTheme({
typography: {
// Tell Material-UI what's the font-size on the html element is.
htmlFontSize: 10,
},
});
Run Code Online (Sandbox Code Playgroud)
先感谢您。
我有一个组件,它有一个可以单击的按钮。它得到了它的道具,开始吧:
...
<Button id="buttonAddTreatments"
color={colorOfTheButton}
variant="contained"
onClick={onAddClick}
disabled={disableButton}>
<AddIcon></AddIcon>
</Button>
...
Run Code Online (Sandbox Code Playgroud)
然后,当我将其加载到 Storybook 中时,我尝试使用onClickControls 附加组件在 上键入一个函数,如下所示:
不幸的是,它根本不起作用。我做错了什么?
我想将图例放在图形下面(这很简单),但是代码根本不起作用,给我以下错误:
The types of 'options.legend.position' are incompatible between these types.
Type 'string' is not assignable to type '"bottom" | "left" | "right" | "top" | "chartArea" | undefined'.
Run Code Online (Sandbox Code Playgroud)
更糟糕的是,我在 CodeSandBox 中得到了相同的代码,没有任何区别,并且运行良好......这是它的链接:https://codesandbox.io/s/spring-hill-3nme9 ?file=/src/components /Scatter.tsx
有什么帮助吗?谢谢!
add-on ×1
charts ×1
controls ×1
css ×1
font-size ×1
function ×1
graph ×1
javascript ×1
legend ×1
material-ui ×1
reactjs ×1
storybook ×1
themes ×1
typescript ×1