tiptap: improve heading style

This commit is contained in:
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 { .Resizer {
z-index: 1; z-index: 1;
opacity: .2; opacity: 0.2;
box-sizing: border-box; box-sizing: border-box;
background-clip: padding; background-clip: padding;
} }
@ -89,3 +89,13 @@
.semi-button-disabled { .semi-button-disabled {
pointer-events: none; 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 }} style={{ width: 90, marginRight: 10 }}
> >
<Select.Option value="paragraph"></Select.Option> <Select.Option value="paragraph"></Select.Option>
<Select.Option value={1}>1</Select.Option> <Select.Option value={1}>
<Select.Option value={2}>2</Select.Option> <h1 style={{ margin: 0, fontSize: '1.3em' }}>1</h1>
<Select.Option value={3}>3</Select.Option> </Select.Option>
<Select.Option value={4}>4</Select.Option> <Select.Option value={2}>
<Select.Option value={5}>5</Select.Option> <h2 style={{ margin: 0, fontSize: '1.1em' }}>2</h2>
<Select.Option value={6}>6</Select.Option> </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> </Select>
); );
}; };