Open milkrong opened 5 months ago
You can set this via the editor theme
import type { InitialConfigType } from "@lexical/react/LexicalComposer";
const themeClass: InitialConfigType["theme"] = {
list: {
ol: "list-decimal",
ul: "list-disc",
}
};
and then pass the themeClass
into the initial Config of the LexicalComposer
You can set this via the editor theme
import type { InitialConfigType } from "@lexical/react/LexicalComposer"; const themeClass: InitialConfigType["theme"] = { list: { ol: "list-decimal", ul: "list-disc", } };
and then pass the
themeClass
into the initial Config of theLexicalComposer
@ElasticBottle No, it's not my expectation. I want to support set list-style-type by some selection component in toolbar, which user can change it while using my text-editor. Not just providing a preset in config file by devleoper
e.g
editor.update(() => {
const selection = $getSelection();
if (selection !== null) {
lastSelection.current = selection;
$patchStyleList(selection, {
"list-style": `${value} `,
});
}
}
Hi @milkrong has this been fixed?
No, there are only three list types supported by the list node and no support for adding extra metadata. Like most use cases that lexical doesn't support directly, the solution is to subclass the node and use node replacement to add support for additional properties and classes.
can I work on it @etrepum ?
I am woking on the List plugin. While I have to set the list style type by using theme. Is there any way to support user to change it? as we can set list style type in css