-
Notifications
You must be signed in to change notification settings - Fork 20
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
Changes from all commits
4f8258f
2c3af78
1c48e03
f151038
1152871
85e37c7
2e0c4f3
c67c949
e7ed531
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
title: Tile | ||
layout: layouts/pages/basic.njk | ||
hasToc: true | ||
order: 120 | ||
tags: | ||
- pattern | ||
importElements: | ||
- rh-tile | ||
- rh-cta | ||
- rh-surface | ||
- rh-code-block | ||
--- | ||
|
||
<link rel="stylesheet" href="{{ '/assets/packages/@rhds/elements/elements/rh-table/rh-table-lightdom.css' | url }}"> | ||
<link rel="stylesheet" href="{{ '/styles/samp.css' | url }}"> | ||
|
||
<style> | ||
.grid + rh-cta { | ||
margin-block-start: var(--rh-space-lg, 16px); | ||
} | ||
|
||
rh-tile { | ||
width: 320px; | ||
} | ||
|
||
rh-tile.accented-tile { | ||
position: relative; | ||
overflow: hidden; | ||
border-radius: var(--rh-border-radius-default, 3px); | ||
} | ||
|
||
rh-tile.accented-tile::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: var(--rh-border-width-lg, 3px); | ||
border-block-start-style: solid; | ||
pointer-events: none; | ||
} | ||
</style> | ||
|
||
## Overview | ||
|
||
Tiles are flexible layouts with clickable and contained surfaces. | ||
|
||
|
||
## Accented tile | ||
|
||
The accented tile pattern should be used to draw attention to a specifc tile or set of tiles. Be careful not to apply the accented tile pattern to all tiles within a page, otherwise the accent effect will be lost. After all, "if everything is special, then nothing is special." | ||
|
||
<div id="rhds-help-grid" class="grid sm-two-columns"> | ||
<div class="sample"> | ||
<h3>Example</h3> | ||
<uxdot-example width-adjustment="752px"> | ||
<rh-tile class="accented-tile"> | ||
<h2 slot="headline"><a href="#top">Link</a></h2> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</rh-tile> | ||
</uxdot-example> | ||
</div> | ||
<div class="sample-code"> | ||
<h3>CSS</h3> | ||
<rh-code-block> | ||
<script type="text/css">rh-tile.accented-tile { | ||
position: relative; | ||
overflow: hidden; | ||
border-radius: var(--rh-border-radius-default, 3px); | ||
} | ||
rh-tile.accented-tile::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: var(--rh-border-width-lg, 3px); | ||
border-block-start-style: solid; | ||
pointer-events: none; | ||
}</script> | ||
</rh-code-block> | ||
</div> | ||
</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to get the bottom of the code block (or the CTA) and image container to line up when they're next to each other? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zeroedin I was thinking about this exact thing last night. Will do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, prefer the |
||
<rh-cta><a href="/elements/tile/demos/#demo-accented-tiles">View accented tile demo</a></rh-cta> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Video thumbnail | ||
order: 120 | ||
order: 130 | ||
hasToc: true | ||
tags: | ||
- pattern | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<rh-context-demo> | ||
<rh-tile-group> | ||
<rh-tile class="accented-tile"> | ||
<h2 slot="headline"><a href="#top">Link</a></h2> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</rh-tile> | ||
|
||
<rh-tile class="accented-tile"> | ||
<h2 slot="headline"><a href="#top">Link 2</a></h2> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</rh-tile> | ||
|
||
<rh-tile class="accented-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); | ||
} | ||
|
||
rh-tile { | ||
width: 320px; | ||
} | ||
|
||
rh-tile.accented-tile { | ||
position: relative; | ||
overflow: hidden; | ||
border-radius: var(--rh-border-radius-default, 3px); | ||
} | ||
|
||
rh-tile.accented-tile::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: var(--rh-border-width-lg, 3px); | ||
border-block-start-style: solid; | ||
pointer-events: none; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe link "Tile" to the Title element page or add a CTA to it