mirror of
https://github.com/usememos/memos.git
synced 2025-11-09 17:01:36 +08:00
chore: update heading styles
This commit is contained in:
parent
8095d94c97
commit
0793f96578
1 changed files with 14 additions and 1 deletions
|
|
@ -8,8 +8,21 @@ interface Props {
|
|||
|
||||
const Heading: React.FC<Props> = ({ level, children }: Props) => {
|
||||
const Head = `h${level}` as keyof JSX.IntrinsicElements;
|
||||
const className = (() => {
|
||||
switch (level) {
|
||||
case 1:
|
||||
return "text-5xl leading-normal font-bold";
|
||||
case 2:
|
||||
return "text-3xl leading-normal font-medium";
|
||||
case 3:
|
||||
return "text-xl leading-normal font-medium";
|
||||
case 4:
|
||||
return "text-lg font-bold";
|
||||
}
|
||||
})();
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<Head className={className}>
|
||||
{children.map((child, index) => (
|
||||
<Renderer key={`${child.type}-${index}`} node={child} />
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue