baerrach / gatsby-remark-plantuml

Gatsby Remark parser for PlantUML code blocks
Other
3 stars 4 forks source link

maxWidth does not work because style attribute overrides it #4

Closed baerrach closed 4 years ago

baerrach commented 4 years ago

See #1

You can see from the generated svg for max-width-option-overrides-svg-width-and-svg-height-but-viewbox-is-unaltered-1.html that it has a style attribute

 style="width:1196px;height:526px;"

Plugin needs to remove any width or height from the style attribute

bharatrajagopalan commented 4 years ago

Hi

I am currently working around this by adding the following in index.scss. This will work as long as plantuml is the only svg is being generated - that may not be always the case.

//plantuml styling - override height with !important to ensure that aspect ratio is kept
svg {
    max-width:100% ;height:auto !important
}
baerrach commented 4 years ago

Fixed by #15