NABI NOTE
Docs

Font size

Description

fontSize() sets a paragraph's size in five steps — extra small, small, default, large, extra large.

  • Pressing the button opens a secondary toolbar showing the five steps in your language, each drawn at its own size — the name is its own preview.
  • Default is a cancel, not a value. Picking it drops the attribute; nothing is stored. Picking the current step again also returns to default.
  • Only four values are ever stored — data-nabi-size="xs|sm|lg|xl". Unknown values are dropped by the filter.
  • It applies to paragraphs only. Headings have their own sizes, and the filter never keeps block attributes inside table cells or list items — enforced by the filter, not by CSS convention.
  • Sizes are relative to the body (em tokens). Change --nabi-font-size on the host and all five steps scale with it. The step values themselves are tokens (--nabi-size-xs …) you can swap.
StepStored valueDefault size
Extra smallxs0.75em
Smallsm0.875em
Default— (no attribute)1em
Largelg1.25em
Extra largexl1.5em

Demo

Wings
HTMLLoading the editor…
PreviewThe value above, drawn the way a reader sees it (nabiViewer). Click a table header to sort.
Install
npm install nabi-note
Code
import { nabi } from 'nabi-note'
import 'nabi-note/style.css'

nabi.create('#editor', {
  wings: [],
  locale: 'en',
  onChange: (html) => save(html),
})