import { Mark } from '@tiptap/core'; /** * Interface defining the attributes for the FontSize mark. */ interface FontSizeAttributes { /** The font size value as a string (e.g. "14", "14px", "1.5rem") or CSS variable. */ size: string | null; } /** * Custom TipTap mark that applies an inline font-size to selected text. * * This mark wraps text in `` and parses it back. * Supports plain numbers (converted to px), numbers with CSS units, and CSS variables. * Validates all font size values to prevent CSS injection attacks. * * @example * // Plain number (will be converted to px) * editor.chain().focus().setMark('fontSize', { size: '14' }).run(); * // With px unit * editor.chain().focus().setMark('fontSize', { size: '14px' }).run(); * // With rem unit * editor.chain().focus().setMark('fontSize', { size: '1.5rem' }).run(); * // CSS variable * editor.chain().focus().setMark('fontSize', { size: 'var(--typography-base-sizes-small-font-size)' }).run(); * // Remove font size * editor.chain().focus().removeMark('fontSize').run(); */ declare const FontSize: Mark, FontSizeAttributes>; export default FontSize;