|
|
@ -1,6 +1,5 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { getContext } from "svelte" |
|
|
import { getContext } from "svelte" |
|
|
import { cssVars } from "./helpers" |
|
|
|
|
|
|
|
|
|
|
|
const { styleable } = getContext("sdk") |
|
|
const { styleable } = getContext("sdk") |
|
|
const component = getContext("component") |
|
|
const component = getContext("component") |
|
|
@ -18,20 +17,14 @@ |
|
|
export let imageWidth |
|
|
export let imageWidth |
|
|
export let imageHeight |
|
|
export let imageHeight |
|
|
|
|
|
|
|
|
$: cssVariables = { |
|
|
|
|
|
imageWidth, |
|
|
|
|
|
cardWidth, |
|
|
|
|
|
imageHeight, |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$: showImage = !!imageUrl |
|
|
$: showImage = !!imageUrl |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<div |
|
|
<div |
|
|
use:styleable={$component.styles} |
|
|
use:styleable={$component.styles} |
|
|
use:cssVars={cssVariables} |
|
|
class="container" |
|
|
class="container"> |
|
|
style="--cardWidth: {cardWidth}"> |
|
|
{#if showImage}<img class="image" src={imageUrl} alt="" />{/if} |
|
|
{#if showImage}<img style="--imageWidth: {imageWidth}; --imageHeight: {imageHeight}" class="image" src={imageUrl} alt="" />{/if} |
|
|
<div class="content"> |
|
|
<div class="content"> |
|
|
<main> |
|
|
<main> |
|
|
<h2 class="heading">{heading}</h2> |
|
|
<h2 class="heading">{heading}</h2> |
|
|
|