You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
New features
Variable based dark color (Experimentail feature: VariableBasedDarkColor) (#1531)
Implement dark mode using variable-based CSS color. To use this feature, enable experimental feature VariableBasedDarkColor and check all your function calls to setColor() and applyFormat() of roosterjs then add parameter darkColorHandler to them.
VariableBasedDarkColor: Use variable-based dark mode solution rather than dataset-based solution. When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat if you need them work for dark mode
New parameter of API applyFormat, setColor
darkColorHandler: A color handler for dark mode for new variable-based dark mode solution
New interface DarkColorHandler
registerColor(lightModeColor: string, isDarkMode: boolean, darkModeColor?: string): string;
Given a light mode color value and an optional dark mode color value, register this color so that editor can handle it, then return the CSS color value for current color mode.
reset(): void;
Reset known color record, clean up registered color variables.
parseColorValue(color: string | null | undefined): ColorKeyAndValue;
Parse an existing color value, if it is in variable-based color format, extract color key, light color and query related dark color if any.
New member of interface EditorCore
darkColorHandler: Dark model handler for the editor, used for variable-based solution. If keep it null, editor will still use original dataset-based dark mode solution.
New method or IEditor and Editor
getDarkColorHandler: Get a dark color handler for variable-based dark mode solution. Need to enable experimental feature VariableBasedDarkColor
New member of interface ElementBasedFormatState
isCodeBlock: Whether the text is in Code block
canMergeTableCell: Whether we can execute table cell merge operation