mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-18 11:44:07 +01:00
#1542 Setting theme options as the regular options
This commit is contained in:
60
src/styles.js
Normal file
60
src/styles.js
Normal 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;
|
||||
Reference in New Issue
Block a user