Of course, CommaJS comes with the most common styles already configured. As a reference, the following is our default configuration. Whatever you decide to specify in .style will be merged with our default configuration. Feel free to add or overwrite your own styles as described in the previous section.
const AllStyles = {
bold: {
applyAs: "style",
name: "fontWeight",
on: "bold",
off: "normal"
},
italic: {
applyAs: "style",
name: "fontStyle",
on: "italic",
off: "normal"
},
underlined: {
applyAs: "style",
name: "textDecorationLine",
on: "underline",
off: "none",
preserve: true
},
strike: {
applyAs: "style",
name: "textDecorationLine",
on: "line-through",
off: "none",
preserve: true
},
fontSize: {
applyAs: "style",
name: "fontSize",
on: "set#by#user",
off: "initial"
},
fontFamily: {
applyAs: "style",
name: "fontFamily",
on: "set#by#user",
off: "initial"
},
fontColor: {
applyAs: "style",
name: "color",
on: "set#by#user",
off: "initial",
isColor: true
},
backgroundColor: {
applyAs: "style",
name: "backgroundColor",
on: "set#by#user",
off: "initial",
isColor: true
},
align: {
applyAs: "style",
name: "textAlign",
on: "set#by#user",
off: "left"
},
indent: {
applyAs: "style",
name: "paddingLeft",
step: 40,
preserve: false,
calculated: true,
unit: "px",
on: 0,
off:0,
},
lineSpacing: {
applyAs: "style",
name: "lineHeight",
on: "set#by#user",
off: "normal"
},
horizontalRule: {
applyAs: "style",
name: "borderBottom",
on: "1px solid #8c8c8c",
off: "none"
},
headerOne: {
applyAs: "class",
classes: ["headerOne"]
},
headerTwo: {
applyAs: "class",
classes: ["headerTwo"]
},
headerThree: {
applyAs: "class",
classes: ["headerThree"]
},
superscript: {
applyAs: "class",
classes: ["scplSup"],
isToggle: true
},
subscript: {
applyAs: "class",
classes: ["scplSub"],
isToggle: true
},
splitSelection: {
applyAs: "class",
classes: ["splitSelectionDummy"]
}
}