AIO 編輯器
FontSize
字級。
文字字級(輸出 font-size style),自製 extension,樣式掛於 TextStyle mark。
- config key:
AioEditorCoreExtension.FontSize - 來源:自製
載入途徑:跟隨 features 宣告:FontSizeSelect、FontSizeIncrease、FontSizeDecrease。按鈕未宣告但要保留能力 → include: [AioEditorCoreExtension.FontSize]。
排除影響(exclude: [FontSize]): 按鈕 FontSizeSelect、FontSizeIncrease、FontSizeDecrease 將自動隱藏; 以 extraExtensions 補上同名 extension(fontSize)即為替換。
選項
| 欄位 | 型別 | 預設值 | 說明 |
|---|---|---|---|
types | string[] | ['textStyle'] | 樣式套用之目標 mark 型別 |
defaultFontSize | string | '' | unsetFontSize 之回復值;空字串代表直接移除 font-size 樣式 |
Commands
| Command | 說明 |
|---|---|
setFontSize(fontSize) | 設定字級(CSS 值,如 '14px') |
unsetFontSize() | 回復預設字級 |
覆寫範例
const config: AioEditorConfig = { extensionsConfig: { FontSize: { defaultFontSize: '16px' } }}