mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
Theme support for mindmaps
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user