Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tile): compact link icon layout #2082

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions .changeset/clever-webs-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rhds/elements": patch
---
`<rh-tile>`: fixed layout of compact link tiles with icons
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<rh-tile compact bleed>
<rh-icon slot="icon" set="standard" icon="mug"></rh-icon>
<svg slot="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 120">
<title>A placeholder image in a card header slot</title>
<rect x="0"
y="0"
width="320"
height="120"
fill="var(--rh-color-interactive-primary-default)"
fill-opacity="0.2"
stroke="var(--rh-color-interactive-primary-hover)"
stroke-width="1"
stroke-dasharray="1 1"
/>
</svg>
<h2 slot="headline"><a href="#top">Compact link tile</a></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eleifend elit set est egestat, a sollicitudn mauris tincidunt.</p>
</rh-tile>


<script type="module">
import '@rhds/elements/rh-tile/rh-tile.js';
</script>

<link rel="stylesheet" href="../rh-tile-lightdom.css">

<style>
rh-tile rh-icon {
color: var(--rh-color-brand-red);
}
</style>

18 changes: 18 additions & 0 deletions elements/rh-tile/demo/compact-link-with-icon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<rh-tile compact desaturated>
<h2 slot="headline"><a href="#top">Compact link tile</a></h2>
<rh-icon slot="icon" set="standard" icon="mug"></rh-icon>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eleifend elit set est egestat, a sollicitudn mauris tincidunt.</p>
</rh-tile>

<script type="module">
import '@rhds/elements/rh-tile/rh-tile.js';
</script>

<link rel="stylesheet" href="../rh-tile-lightdom.css">

<style>
rh-tile rh-icon {
color: var(--rh-color-brand-red);
}
</style>

32 changes: 32 additions & 0 deletions elements/rh-tile/demo/compact-link-with-image-and-icon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<rh-tile compact>
<rh-icon slot="icon" set="standard" icon="mug"></rh-icon>
<svg slot="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 120">
<title>A placeholder image in a card header slot</title>
<rect x="0"
y="0"
width="320"
height="120"
fill="var(--rh-color-interactive-primary-default)"
fill-opacity="0.2"
stroke="var(--rh-color-interactive-primary-hover)"
stroke-width="1"
stroke-dasharray="1 1"
/>
</svg>
<h2 slot="headline"><a href="#top">Compact link tile</a></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eleifend elit set est egestat, a sollicitudn mauris tincidunt.</p>
</rh-tile>


<script type="module">
import '@rhds/elements/rh-tile/rh-tile.js';
</script>

<link rel="stylesheet" href="../rh-tile-lightdom.css">

<style>
rh-tile rh-icon {
color: var(--rh-color-brand-red);
}
</style>

18 changes: 18 additions & 0 deletions elements/rh-tile/demo/compact-link-with-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<rh-tile compact desaturated>
<h2 slot="headline"><a href="#top">Compact link tile</a></h2>
<rh-icon slot="icon" set="standard" icon="mug"></rh-icon>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eleifend elit set est egestat, a sollicitudn mauris tincidunt.</p>
</rh-tile>

<script type="module">
import '@rhds/elements/rh-tile/rh-tile.js';
</script>

<link rel="stylesheet" href="../rh-tile-lightdom.css">

<style>
rh-tile rh-icon {
color: var(--rh-color-brand-red);
}
</style>

6 changes: 5 additions & 1 deletion elements/rh-tile/rh-tile.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
#inner,
#content {
display: flex;
flex-flow: column;
flex-direction: column;
}

.compact #inner {
flex-direction: row;
}

#outer,
Expand Down
Loading