Skip to content

Commit

Permalink
better svg layout handling padding
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Apr 7, 2020
1 parent ae6de4a commit 7f586d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Layouts/SvgSsr.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
<svg
viewBox="0 0 100 100"
preserveAspectRatio="none"
style="top: {$padding.top}px; right:{$padding.right}px; bottom:{$padding.bottom}px; left:{$padding.left}px;{zIndexStyle}"
style="top: {$padding.top}px; right:0px; bottom:0px; left:{$padding.left}px;width:calc(100% - {($padding.left + $padding.right)}px);height:calc(100% - {($padding.top + $padding.bottom)}px);'{zIndexStyle}"
>
<slot></slot>
<g transform="translate({$padding.left}px, {$padding.top}px)">
<slot></slot>
</g>
</svg>

<style>
Expand Down

0 comments on commit 7f586d8

Please sign in to comment.