| 99 | } |
| 100 | |
| 101 | function buildGuideStyle(levels: number, guideStepPx: number): string { |
| 102 | const images = []; |
| 103 | const positions = []; |
| 104 | const sizes = []; |
| 105 | |
| 106 | for (let i = 0; i < levels; i++) { |
| 107 | const color = "var(--indent-guide-color)"; |
| 108 | images.push(`linear-gradient(${color}, ${color})`); |
| 109 | positions.push(`${i * guideStepPx}px 0`); |
| 110 | sizes.push("1px 100%"); |
| 111 | } |
| 112 | |
| 113 | return [ |
| 114 | `background-image:${images.join(",")}`, |
| 115 | "background-repeat:no-repeat", |
| 116 | `background-position:${positions.join(",")}`, |
| 117 | `background-size:${sizes.join(",")}`, |
| 118 | ].join(";"); |
| 119 | } |
| 120 | |
| 121 | function getGuideStyle( |
| 122 | levels: number, |