块组件(Block)
块组件用于在文档中标记处一块高亮区域,可用于表示文档中的重要内容。
组件定义
- src/components/Block/index.tsx
- src/components/Block/style.module.css
import React from 'react';
import MDXContent from '@theme/MDXContent';
import styles from './style.module.css'
export default function Block({children, title}) {
return (<div className={styles.mathnotesBlock}>
<MDXContent>
{title && <div className={styles.title}>{title}</div>}
{children}
</MDXContent>
</div>);
}
.mathnotesBlock {
border: 1px solid #4E9EEF;
border-radius: 10px;
padding: 10px;
margin-bottom: 20px;
background-color: rgba(189, 214, 238, 0.25);
}
.mathnotesBlock p:last-child {
padding-bottom: 0;
margin-bottom: 0;
}
.title {
font-weight: bold;
font-size: 1.25rem;
margin-bottom: 20px;
text-align: center;
}