எழுத்து நிறம் ​

தேர்ந்தெடுத்த எழுத்துக்கு நிறப் பெயரைப் பயன்படுத்துகிறது. சேமிக்கப்படும் மதிப்பு CSS நிறச் சரம் அல்ல; அனுமதிக்கப்பட்ட பெயர். உண்மையான நிறம் --nabi-tc-<name> CSS மாறியால் தீர்மானிக்கப்படுகிறது. அதனால் ஒரே ஆவணத்தையும் ஒளி மற்றும் இருண்ட தீம்களில் வாசிக்க ஏற்றபடி மாற்றலாம்.

சிறகுகள்
அடிப்படை எழுத்துருஇடமாற்றம்
HTMLதொகுப்பி ஏற்றப்படுகிறது…
JSONnabi-treeதொகுப்பி ஏற்றப்படுகிறது…
நிறுவு
npm install nabi-note
நிரல்
import {
  createLocale, createNabiWith, mountSurface, mountToolbar,
  mountContextToolbar, mountHints, watchSettle, textColorWing,
  highlightWing, mountViewTools,
} from 'nabi-note'

const selected = [
  textColorWing,
  highlightWing,
]
const locale = createLocale('ta')
const { nabi, registry } = createNabiWith(selected, { locale })

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 })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale }
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()))

// Call from your language selector. Content and editing history stay intact.
// locale.setLocale('ko')
ts
const selected = wings().use('tc', {
  values: ['green', 'coral', 'blue'],
}).build()

values ஐ விடுத்தால் அடிப்படை palette (green, coral, violet, amber, blue) பயன்படுத்தப்படும். பட்டியலைக் குறைத்தால் மற்ற நிறங்கள் கட்டளையிலும் ஏற்றுதலிலும் ஏற்கப்படாது.

CSS பாணிகள் ​

ஆவணத்தில் நிறப் பெயர் மட்டுமே சேமிக்கப்படும். தொகுப்பி மற்றும் வெளியீட்டுப் பக்கத்தின் உண்மையான நிறத்தை CSS மாறிகளால் தீர்மானிக்கவும்.

css
.nabi-content { --nabi-tc-blue: #2563eb; }

எழுத்து நிறத்தைப் பின்னணி நிறத்துடன் சேர்த்து மாற்றி எதிர்மறையைச் சரிபார்க்கவும். இருண்ட தீமில் அதே நிறப் பெயருக்கு வேறு மதிப்பளிக்கலாம்.

css
.dark .article-body {
  --nabi-tc-blue: #93c5fd;
  --nabi-tc-green: #86efac;
}