typescript - 如何为 H1/H2/.. 标签应用站点范围的样式?
问题描述
我曾经这样做:
import {createMuiTheme} from '@material-ui/core/styles';
export const theme = createMuiTheme({
typography: {
h1: {
fontSize: '2.85em',
margin: '0 0 16px', // <-- dies
},
// ..
});
但是编译器死了说边距不能分配给 TypographyStyleOptions。
TS2326: Types of property 'h1' are incompatible.
输入'{字体大小:字符串;边距:字符串;}' 不可分配给类型 'TypographyStyleOptions'。对象字面量只能指定已知属性,并且类型“TypographyStyleOptions”中不存在“边距”。
在我更新一些软件包之前它曾经工作过。
在这里为每个组件应用样式对我不起作用,因为我需要在 Markdown 渲染器中使用这些样式,它不会输出 React 组件
解决方案
推荐阅读
- css - 'a:link {color}' CSS 选择器的问题
- c# - Selenium WebDriver - 突出显示解决方案中的所有 Web 元素
- ksh - 这个符号是什么意思“#?” 在 ksh
- javascript - 第一次安装expo,初始化后立即报错
- html - 未针对锚元素触发 MouseLeave 事件
- angular - 离子:第一次页面加载视频播放器工作,导航回视频播放器后不显示
- linked-list - 在 OCAML 中使用链表队列进行删除
- java - javac为什么不能用finalize编译类
- windows - Windows命令行:findstr.exe在find find.exe找到时无法在某些文件中找到字符串
- python - 正则表达式如何仅删除包含某些特定字母的单词