diff --git a/frontend/app_flowy/lib/plugins/doc/editor_styles.dart b/frontend/app_flowy/lib/plugins/doc/editor_styles.dart index dc472aeaf1..09437ff36d 100644 --- a/frontend/app_flowy/lib/plugins/doc/editor_styles.dart +++ b/frontend/app_flowy/lib/plugins/doc/editor_styles.dart @@ -55,7 +55,25 @@ EditorStyle customEditorStyle(BuildContext context) { headingToPadding[node.attributes.heading] ?? basePadding; return EdgeInsets.only(bottom: padding); }, - ) + ), + 'text/number-list': builtInPluginStyle + ..addAll( + { + 'numberColor': (EditorState editorState, Node node) { + final theme = context.watch(); + return theme.isDark ? Colors.white : Colors.black; + }, + }, + ), + 'text/bulleted-list': builtInPluginStyle + ..addAll( + { + 'bulletColor': (EditorState editorState, Node node) { + final theme = context.watch(); + return theme.isDark ? Colors.white : Colors.black; + }, + }, + ), }, ); } diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/bulleted_list_text.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/bulleted_list_text.dart index 36e3568684..5fbac22824 100644 --- a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/bulleted_list_text.dart +++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/bulleted_list_text.dart @@ -64,6 +64,18 @@ class _BulletedListTextNodeWidgetState extends State return super.baseOffset.translate(0, padding.top); } + Color get bulletColor { + final bulletColor = widget.editorState.editorStyle.style( + widget.editorState, + widget.textNode, + 'bulletColor', + ); + if (bulletColor is Color) { + return bulletColor; + } + return Colors.black; + } + @override Widget buildWithSingle(BuildContext context) { return Padding( @@ -76,6 +88,7 @@ class _BulletedListTextNodeWidgetState extends State width: iconSize?.width, height: iconSize?.height, padding: iconPadding, + color: bulletColor, name: 'point', ), Flexible( diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/number_list_text.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/number_list_text.dart index 6ce4bd0fee..6d8004028b 100644 --- a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/number_list_text.dart +++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/rich_text/number_list_text.dart @@ -58,6 +58,18 @@ class _NumberListTextNodeWidgetState extends State return super.baseOffset.translate(0, padding.top); } + Color get numberColor { + final numberColor = widget.editorState.editorStyle.style( + widget.editorState, + widget.textNode, + 'numberColor', + ); + if (numberColor is Color) { + return numberColor; + } + return Colors.black; + } + @override Widget build(BuildContext context) { return Padding( @@ -70,8 +82,11 @@ class _NumberListTextNodeWidgetState extends State padding: iconPadding, child: Text( '${widget.textNode.attributes.number.toString()}.', - // FIXME: customize - style: const TextStyle(fontSize: 16.0, color: Colors.black), + style: TextStyle( + fontSize: widget.editorState.editorStyle.textStyle + .defaultTextStyle.fontSize, + color: numberColor, + ), ), ), Flexible( diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/style/editor_style.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/style/editor_style.dart index a8cc9eb638..331ec1d1af 100644 --- a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/style/editor_style.dart +++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/style/editor_style.dart @@ -117,12 +117,20 @@ Map builtInTextStylers = { ), 'text/bulleted-list': builtInPluginStyle, 'text/number-list': builtInPluginStyle - ..update( - 'iconPadding', - (_) => (EditorState editorState, Node node) { + ..addAll({ + 'numberColor': (EditorState editorState, Node node) { + return Colors.black; + }, + 'iconPadding': (EditorState editorState, Node node) { return const EdgeInsets.only(left: 5.0, right: 5.0); }, - ), + }), + 'text/bulleted-list': builtInPluginStyle + ..addAll({ + 'bulletColor': (EditorState editorState, Node node) { + return Colors.black; + }, + }), 'text/quote': builtInPluginStyle, 'image': builtInPluginStyle, };