improve collab cursor styling

This commit is contained in:
Hans Pagel
2020-09-27 10:37:48 +02:00
parent 149ce56ad8
commit a6bcea4458
2 changed files with 8 additions and 12 deletions

View File

@@ -34,10 +34,11 @@ export default new Extension<CollaborationCursorOptions>()
color: '#cccccc',
render: user => {
const cursor = document.createElement('span')
cursor.classList.add('collaboration-cursor')
cursor.classList.add('collaboration-cursor__caret')
cursor.setAttribute('style', `border-color: ${user.color}`)
const label = document.createElement('div')
label.classList.add('collaboration-cursor__label')
label.setAttribute('style', `background-color: ${user.color}`)
label.insertBefore(document.createTextNode(user.name), null)
cursor.insertBefore(label, null)