#1542 Setting theme options as the regular options

This commit is contained in:
Knut Sveidqvist
2020-07-16 23:39:38 +02:00
parent 8c0e022b44
commit fd4240b774
17 changed files with 477 additions and 1450 deletions

60
src/styles.js Normal file
View File

@@ -0,0 +1,60 @@
import getFlowchartStyles from './diagrams/flowchart/styles';
const themes = {
flowchart: getFlowchartStyles
};
const getStyles = (type, userStyles, options) =>
`:root {
--mermaid-font-family: '"trebuchet ms", verdana, arial';
font-family: '"trebuchet ms", verdana, arial';
font-family: var(--mermaid-font-family);
font-size: 16px;
}
/* Classes common for multiple diagrams */
.error-icon {
fill: ${options.errorBkgColor};
}
.error-text {
fill: ${options.errorTextColor};
stroke: ${options.errorTextColor};
}
.edge-thickness-normal {
// stroke: ${options.lineColor};
stroke-width: 2px;
}
.edge-thickness-thick {
// stroke: ${options.lineColor};
stroke-width: 3.5px
}
.edge-pattern-solid {
stroke-dasharray: 0;
}
.edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
.marker {
fill: ${options.lineColor};
}
.marker.cross {
stroke: ${options.lineColor};
}
svg {
font-family: var(--mermaid-font-family);
}
${themes[type](options)}
${userStyles}
`;
export default getStyles;