tiptap: improve heading style

pull/29/head
fantasticit 2022-04-25 09:55:59 +08:00
parent 8f9cecf277
commit 7d1afdd394
2 changed files with 29 additions and 7 deletions

View File

@ -27,7 +27,7 @@
.Resizer {
z-index: 1;
opacity: .2;
opacity: 0.2;
box-sizing: border-box;
background-clip: padding;
}
@ -89,3 +89,13 @@
.semi-button-disabled {
pointer-events: none;
}
.semi-select-selection-text {
font-size: 1em;
font-weight: normal;
> * {
font-size: inherit !important;
font-weight: inherit;
}
}

View File

@ -30,12 +30,24 @@ export const Heading: React.FC<{ editor: Editor }> = ({ editor }) => {
style={{ width: 90, marginRight: 10 }}
>
<Select.Option value="paragraph"></Select.Option>
<Select.Option value={1}>1</Select.Option>
<Select.Option value={2}>2</Select.Option>
<Select.Option value={3}>3</Select.Option>
<Select.Option value={4}>4</Select.Option>
<Select.Option value={5}>5</Select.Option>
<Select.Option value={6}>6</Select.Option>
<Select.Option value={1}>
<h1 style={{ margin: 0, fontSize: '1.3em' }}>1</h1>
</Select.Option>
<Select.Option value={2}>
<h2 style={{ margin: 0, fontSize: '1.1em' }}>2</h2>
</Select.Option>
<Select.Option value={3}>
<h3 style={{ margin: 0, fontSize: '1.0em' }}>3</h3>
</Select.Option>
<Select.Option value={4}>
<h4 style={{ margin: 0, fontSize: '0.9em' }}>4</h4>
</Select.Option>
<Select.Option value={5}>
<h5 style={{ margin: 0, fontSize: '0.8em' }}>5</h5>
</Select.Option>
<Select.Option value={6}>
<h6 style={{ margin: 0, fontSize: '0.8em' }}>6</h6>
</Select.Option>
</Select>
);
};