Launin rubutu
Sanya sunan launi da aka yarda da shi ga rubutun da aka zaɓa. Ƙimar da aka adana ba jerin launin CSS ba ce: suna ne da aka yarda da shi, kuma ainihin launin mai canjin CSS --nabi-tc-<name> ne yake ƙayyade shi. Saboda haka takarda ɗaya tana iya zama mai sauƙin karantawa a yanayin haske da duhu.
Fuka-fukai
Nau’in rubutu na asaliTazara
HTMLAna loda edita…
JSONnabi-treeAna loda edita…
Sanya
npm install nabi-noteLamba
import {
createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
mountHints, watchSettle, textColorWing, highlightWing, mountViewTools,
} from 'nabi-note'
const selected = [
textColorWing,
highlightWing,
]
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: 'ha' })
const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'ha' }
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('tc', {
values: ['green', 'coral', 'blue'],
}).build()Idan aka bar values, rumbun tsoho shi ne green, coral, violet, amber, da blue. Idan aka rage jerin, umarni da buɗe takarda ba za su karɓi sauran launuka ba.
Salon CSS
Takarda tana adana sunan launi kawai. Ƙayyade ainihin launi na editan da shafin da aka buga da masu canjin CSS.
css
.nabi-content { --nabi-tc-blue: #2563eb; }Duba bambancin launi tare da bayan fage. A yanayin duhu, suna ɗaya na launi zai iya samun ƙima dabam.
css
.dark .article-body {
--nabi-tc-blue: #93c5fd;
--nabi-tc-green: #86efac;
}