AIO 編輯器
Color
文字顏色。
文字顏色,樣式掛於 TextStyle mark。toolbar 之 TextColor 按鈕即操作此 extension。
- config key:
AioEditorCoreExtension.Color - 來源:
@tiptap/extension-text-style(Color)
載入途徑:跟隨 features 宣告:TextColor。按鈕未宣告但要保留能力 → include: [AioEditorCoreExtension.Color]。
排除影響(exclude: [Color]): 按鈕 TextColor 將自動隱藏; 以 extraExtensions 補上同名 extension(color)即為替換。
選項
| 欄位 | 型別 | 預設值 | 說明 |
|---|---|---|---|
types | string[] | ['textStyle'] | 樣式套用之目標 mark 型別 |
Commands
| Command | 說明 |
|---|---|
setColor(color) | 設定文字顏色(CSS 色值) |
unsetColor() | 移除文字顏色 |
覆寫範例
const config: AioEditorConfig = { extensionsConfig: { Color: { types: ['textStyle'] } }}