Theme support for mindmaps

This commit is contained in:
Knut Sveidqvist
2022-07-25 17:03:18 +02:00
parent f815bd08b7
commit 0b2ca29ae8
4 changed files with 54 additions and 38 deletions

View File

@@ -1,9 +1,37 @@
const genSections = (options) => {
let sections = '';
for (let i = 1; i < 8; i++) {
const sw = '' + (17 - 3 * i);
sections += `
.section-${i - 1} rect {
fill: ${options['git' + i]};
}
.section-${i - 1} text {
fill: ${options['gitBranchLabel' + i]};
}
.section-edge-${i - 1}{
stroke: ${options['git' + i]};
}
.edge-depth-${i - 1}{
stroke-width: ${sw};
}
`;
}
return sections;
};
const getStyles = (options) =>
`
.node{
stroke: ${options.pieStrokeColor};
stroke-width : ${options.pieStrokeWidth};
opacity : ${options.pieOpacity};
.edge {
stroke-width: 3;
}
${genSections(options)}
.section-root rect {
fill: ${options.git0};
}
.section-root text {
fill: ${options.gitBranchLabel0};
}
`;
export default getStyles;