| 750 | } |
| 751 | |
| 752 | function buildSetStyleSection(): HTMLDivElement { |
| 753 | const colorInput = mkInput("#f43f5e", "#f43f5e"); |
| 754 | colorInput.style.width = "100px"; |
| 755 | const setColor = mkBtn("Headline color", "primary", () => { |
| 756 | if (!needSelection()) return; |
| 757 | comp!.setStyle(selectedId!, { color: colorInput.value }); |
| 758 | logEntry("op", { setStyle: { id: selectedId, color: colorInput.value } }); |
| 759 | }); |
| 760 | const bold = mkBtn("Bold", "", () => |
| 761 | comp!.setStyle(selectedId ?? "hf-headline", { fontWeight: "700" }), |
| 762 | ); |
| 763 | const reset = mkBtn("Reset weight", "", () => |
| 764 | comp!.setStyle(selectedId ?? "hf-headline", { fontWeight: null }), |
| 765 | ); |
| 766 | return opSection("setStyle", opRow(colorInput, setColor), opRow(bold, reset)); |
| 767 | } |
| 768 | |
| 769 | function buildSetTextSection(): HTMLDivElement { |
| 770 | const textInput = mkInput("new text", ""); |