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

feat(tile): accented tile CSS pattern demo #1721

Merged
merged 9 commits into from
Aug 7, 2024
66 changes: 66 additions & 0 deletions elements/rh-tile/demo/accented-tiles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<rh-context-demo>
<rh-tile-group class="accented-tiles">
<rh-tile>
<h2 slot="headline"><a href="#top">Link</a></h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</rh-tile>

<rh-tile>
<h2 slot="headline"><a href="#top">Link 2</a></h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</rh-tile>

<rh-tile>
<h2 slot="headline"><a href="#top">Link 2</a></h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</rh-tile>
</rh-tile-group>
</rh-context-demo>

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

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

<style>
rh-context-demo::part(demo) {
display: flex;
align-items: top;
flex-wrap: wrap;
gap: var(--rh-space-2xl, 32px);
}

rh-tile-group {
display: flex;
align-items: top;
flex-wrap: wrap;
column-gap: var(--rh-space-2xl, 32px);
row-gap: var(--rh-space-2xl, 32px);
margin-inline-end: var(--rh-space-md, 8px);
& > * {
width: 320px;
}
}

.accented-tiles {
& rh-tile {
position: relative;
overflow: hidden;
border-radius: var(--rh-border-radius-default, 3px);
&::before {
content: '';
position: absolute;
z-index: 2;
display: block;
inset-block-start: 0;
inset-inline: 0;
border-block-start-color: var(--rh-color-brand-red-on-light, #ee0000);
border-block-start-width: 3px;
border-block-start-style: solid;
pointer-events: none;
}
}
}
zeroedin marked this conversation as resolved.
Show resolved Hide resolved
</style>
4 changes: 3 additions & 1 deletion elements/rh-tile/demo/custom-props.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ <h2 slot="headline"><a href="#top">Link 2</a></h2>
column-gap: var(--rh-space-2xl, 32px);
row-gap: var(--rh-space-2xl, 32px);
margin-inline-end: var(--rh-space-md, 8px);
& > * {
width: 320px;
}
zeroedin marked this conversation as resolved.
Show resolved Hide resolved
}

rh-tile {
--rh-tile-border-color: red;
--rh-tile-link-color: green;
--rh-tile-interactive-color: rebeccapurple;
--rh-tile-background-color: #f2f2f2;
width: 320px;
}
</style>
Loading