mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-29 16:14:22 -05:00
Replace editor toolbar dividers with css pseudo-selector (#527)
* Remove useless divider-spans from toolbar and change css-selector The use of extra divider elements is not needed as we can set the css-after pseudo-class to the button groups with the same styling. This way we can reduce the amount of elements in the DOM by a hand full. * Use scss syntax and include one rule into another more common one
This commit is contained in:
parent
db4f2a4478
commit
0f30803529
2 changed files with 7 additions and 9 deletions
|
@ -1,9 +1,11 @@
|
|||
.btn-toolbar {
|
||||
border: 1px solid #ededed;
|
||||
}
|
||||
|
||||
.divider {
|
||||
.btn-group:not(:last-of-type)::after {
|
||||
background-color: #e2e6ea;
|
||||
width: 2px;
|
||||
padding: 0.25rem 0;
|
||||
content: ' ';
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,6 @@ export const ToolBar: React.FC<ToolBarProps> = ({ editor, onPreferencesChange, e
|
|||
<ForkAwesomeIcon icon="superscript"/>
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
<span className={'divider'}> </span>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<Button variant='light' onClick={() => addHeaderLevel(editor)} title={t('editor.editorToolbar.header')}>
|
||||
<ForkAwesomeIcon icon="header"/>
|
||||
|
@ -86,7 +85,6 @@ export const ToolBar: React.FC<ToolBarProps> = ({ editor, onPreferencesChange, e
|
|||
<ForkAwesomeIcon icon="check-square"/>
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
<span className={'divider'}> </span>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<Button variant='light' onClick={() => addLink(editor)} title={t('editor.editorToolbar.link')}>
|
||||
<ForkAwesomeIcon icon="link"/>
|
||||
|
@ -98,7 +96,6 @@ export const ToolBar: React.FC<ToolBarProps> = ({ editor, onPreferencesChange, e
|
|||
<ForkAwesomeIcon icon="upload"/>
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
<span className={'divider'}> </span>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<Button variant='light' onClick={() => addTable(editor)} title={t('editor.editorToolbar.table')}>
|
||||
<ForkAwesomeIcon icon="table"/>
|
||||
|
@ -111,7 +108,6 @@ export const ToolBar: React.FC<ToolBarProps> = ({ editor, onPreferencesChange, e
|
|||
</Button>
|
||||
<EmojiPickerButton editor={editor}/>
|
||||
</ButtonGroup>
|
||||
<span className={'divider'}> </span>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<EditorPreferences onPreferencesChange={onPreferencesChange} preferences={editorPreferences}/>
|
||||
</ButtonGroup>
|
||||
|
|
Loading…
Reference in a new issue