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)即為替換。

選項

欄位型別預設值說明
typesstring[]['textStyle']樣式套用之目標 mark 型別

Commands

Command說明
setColor(color)設定文字顏色(CSS 色值)
unsetColor()移除文字顏色

覆寫範例

const config: AioEditorConfig = {  extensionsConfig: {    Color: { types: ['textStyle'] }  }}