mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-19 20:24:16 +01:00
Simplify inline css code
This commit is contained in:
@@ -438,14 +438,7 @@ const render = function (id, txt, cb, container) {
|
|||||||
// insert inline style into svg
|
// insert inline style into svg
|
||||||
const svg = element.firstChild
|
const svg = element.firstChild
|
||||||
const s = document.createElement('style')
|
const s = document.createElement('style')
|
||||||
const cs = window.getComputedStyle(svg)
|
s.innerHTML = themes[config.theme] || defaultTheme
|
||||||
s.innerHTML = `
|
|
||||||
${themes[config.theme] || defaultTheme}
|
|
||||||
svg {
|
|
||||||
color: ${cs.color};
|
|
||||||
font: ${cs.font};
|
|
||||||
}
|
|
||||||
`
|
|
||||||
svg.insertBefore(s, svg.firstChild)
|
svg.insertBefore(s, svg.firstChild)
|
||||||
|
|
||||||
d3.select('#d' + id).selectAll('foreignobject div').attr('xmlns', 'http://www.w3.org/1999/xhtml')
|
d3.select('#d' + id).selectAll('foreignobject div').attr('xmlns', 'http://www.w3.org/1999/xhtml')
|
||||||
|
|||||||
Reference in New Issue
Block a user