Skip to content

Commit

Permalink
Update packages/mermaid/src/diagrams/class/classDb.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Sidharth Vinod <[email protected]>
  • Loading branch information
jgreywolf and sidharthv96 authored Dec 5, 2023
1 parent e25515a commit 02b2d71
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions packages/mermaid/src/diagrams/class/classDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,20 +457,16 @@ export const addClassesToNamespace = function (id: string, classNames: string[])
}
};

export const setCssStyle = function (id: string, style: string[]) {
if (style !== undefined && style !== null) {
const thisClass = classes[id];
if (thisClass !== undefined) {
style.forEach(function (s) {
if (s.includes(',')) {
const styles = s.split(',');
styles.forEach(function (newStyle) {
thisClass.styles.push(newStyle);
});
} else {
thisClass.styles.push(s);
}
});
export const setCssStyle = function (id: string, styles: string[]) {
const thisClass = classes[id];
if (!styles || !thisClass) {
return;
}
for (const s of styles) {
if (s.includes(',')) {
thisClass.styles = thisClass.styles.concat(s.split(','));
} else {
thisClass.styles.push(s);
}
}
};
Expand Down

0 comments on commit 02b2d71

Please sign in to comment.