Skip to content

Commit 840838d

Browse files
authored
lite-youtube fallback class (#2295)
* Add lite-youtube-fallback * Add changeset
1 parent f66e96d commit 840838d

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

.changeset/clear-planets-send.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': minor
3+
---
4+
5+
Add helper class for styling fallback links in [`lite-youtube` web components](https://github.com/justinribeiro/lite-youtube)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@use '../../compiled/tokens/scss/color';
2+
@use '../../compiled/tokens/scss/size';
3+
4+
.lite-youtube-fallback {
5+
aspect-ratio: var(--lite-youtube-aspect-ratio, 16 / 9);
6+
background-color: color.$base-gray-darker;
7+
color: color.$text-light;
8+
display: flex;
9+
padding: size.$padding-control-vertical size.$padding-control-horizontal;
10+
place-content: center;
11+
place-items: center;
12+
text-align: center;
13+
text-wrap: balance;
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<lite-youtube{% if aspect_ratio %} style="--lite-youtube-aspect-ratio: {{aspect_ratio}};"{% endif %}>
2+
<a class="lite-youtube-fallback" href="https://www.youtube.com/watch?v=vU5Cic3HNvc">
3+
Watch on YouTube: “Strategies for Legacy Application Modernization”
4+
</a>
5+
</lite-youtube>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs';
2+
import fallbackDemo from './demo/fallback.twig';
3+
4+
<Meta
5+
title="Vendor/lite-youtube"
6+
argTypes={{
7+
aspect_ratio: {
8+
type: { name: 'string' },
9+
description:
10+
'Value for `--lite-youtube-aspect-ratio` inline style property, sets the aspect ratio prior to component load and helps cut down on page shifts.',
11+
},
12+
}}
13+
/>
14+
15+
# lite-youtube
16+
17+
Our patterns include a `lite-youtube-fallback` class for use with [the `lite-youtube` web component](https://github.com/justinribeiro/lite-youtube).
18+
19+
<Canvas>
20+
<Story name="Default">{(args) => fallbackDemo(args)}</Story>
21+
</Canvas>
22+
23+
<ArgsTable story="Default" />

0 commit comments

Comments
 (0)