Every extension

textStyle

Mark 0.6 kB gzipped

Colour, background, font family and font size, as one mark.

Tiptap ships these as four extensions layered on a `textStyle` mark; here they are one mark with four attributes, so a coloured, resized word is one `<span>` rather than a nest of them. Setting one attribute keeps the others: `setColor('red')` on text already in a different font leaves the font alone.

Adding it

import { createEditor, document, paragraph, text, textStyle } from '@matrajs/core'

const editor = createEditor({
  extensions: [document, paragraph, text, textStyle],
  element: document.querySelector('#editor'),
})

There is no separate package · textStyle is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.

Commands

Attributes

HTML

← All 81 extensions

Edit this page on GitHub