Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/components/image/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ export class Image

const isHeightSpecified = !!this.height;
const isWidthSpecified = !!this.width;
const height = isHeightSpecified
? `calc(${this.height} + var(--margin-top, 0px) + var(--margin-bottom, 0px))`
: null;
const width = isWidthSpecified
? `calc(${this.width} + var(--margin-left, 0px) + var(--margin-right, 0px))`
: null;
return (
<Host
class={{
Expand All @@ -187,12 +193,9 @@ export class Image
style={{
alignSelf: isHeightSpecified ? "unset" : null,
justifySelf: isWidthSpecified ? "unset" : null,
height: isHeightSpecified
? `calc(${this.height} + var(--margin-top, 0px) + var(--margin-bottom, 0px))`
: null,
width: isWidthSpecified
? `calc(${this.width} + var(--margin-left, 0px) + var(--margin-right, 0px))`
: null
height: height,
width: width,
maxWidth: width
}}
>
{body}
Expand Down