अक्षर आकार

निवडलेला text size step मध्ये बदला. range निवडल्यास step त्या range ला लागू होते; फक्त caret असल्यास सध्याच्या paragraph चा text size बदलतो. साठवलेला data फक्त परवानगीचे steps ठेवतो, px सारखी मनमानी values नाही.

विंग्ज
मूलभूत अक्षररूपअंतर
HTMLसंपादक लोड होत आहे…
JSONnabi-treeसंपादक लोड होत आहे…
स्थापित करा
npm install nabi-note
कोड
import {
  createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
  mountHints, watchSettle, boldWing, italicWing, underlineWing,
  strikeWing, typefaceWing, fontSizeWing, clearFormatWing,
  mountViewTools,
} from 'nabi-note'

const selected = [
  boldWing,
  italicWing,
  underlineWing,
  strikeWing,
  typefaceWing,
  fontSizeWing,
  clearFormatWing,
]
const { nabi, registry } = createNabiWith(selected)

const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!

// The locale also sets the direction — Arabic and Urdu run right to left
mountSurface({ nabi, registry, root: content, locale: 'mr' })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'mr' }
const toolbar = mountToolbar({ ...shared, root: document.querySelector('#toolbar')! })
const context = mountContextToolbar({ ...shared, root: document.querySelector('#context')! })
mountHints({ toolbar, context, root, surface: content })
// The preview and fullscreen buttons — they stand their own box at the end of the row
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })

// on every change — hook up your own code here
// nabi.onChange(() => user_callback(nabi.getHtml()))
ts
const selected = wings().use('fs', {
  values: ['sm', 'lg', 'xl'],
}).build()

values वगळल्यास xs, sm, lg आणि xl steps वापरले जातात. सूची अरुंद केल्यास जुन्या documents मध्ये आधीपासून असलेले इतर steps लोड करताना काढले जातात.

CSS शैली

.nabi-content [data-nabi-size="xs"] सारख्या stored-step selectors ने sizes बदलू शकता. document मध्ये नसलेले मनमानी steps तयार करू नका; CSS फक्त नोंदवलेल्या values मध्ये समायोजित करा.

css
.article-body [data-nabi-size="xs"] { font-size: .78em; }
.article-body [data-nabi-size="sm"] { font-size: .9em; }
.article-body [data-nabi-size="lg"] { font-size: 1.3em; }
.article-body [data-nabi-size="xl"] { font-size: 1.65em; }

steps मधील size difference एकसारखा ठेवल्यास document प्रकाशित झाल्यावर लेखकाने editor मध्ये निवडलेला अर्थ टिकतो.