Skip to content

Commit bfb80ed

Browse files
committed
Layout fix for small viewports
1 parent b291cfc commit bfb80ed

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

src/css/tailwind.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,17 @@ details[open] .summary-swap-open {
372372
box-shadow: 0 0 1px 4px #E7017A;
373373
}
374374
}
375-
.aspect-ratio-youtube {
376-
padding-top: 74.9295775%;
375+
376+
.jamstacktv-link {
377+
display: flex;
378+
flex-wrap: wrap;
379+
}
380+
.jamstacktv-card {
381+
flex-basis: 18.75em; /* 300px /16 */
382+
}
383+
.jamstacktv-item {
384+
flex-basis: 18.75em; /* 300px /16 */
385+
flex-grow: 3;
377386
}
378387
.jamstacktv-card,
379388
.jamstacktv-img {
@@ -390,7 +399,7 @@ details[open] .summary-swap-open {
390399
@apply font-bold;
391400
position: absolute;
392401
right: .4em;
393-
bottom: .4em;
402+
top: .4em;
394403
}
395404
.jamstacktv-time {
396405
display: inline-block;
@@ -408,6 +417,7 @@ details[open] .summary-swap-open {
408417
margin-right: 3px;
409418
}
410419
.jamstacktv-item {
420+
@apply p-4;
411421
display: flex;
412422
flex-direction: column;
413423
justify-content: center;

src/site/_includes/search-js.njk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ search.addWidgets([
7878
},
7979
templates: {
8080
item: `
81-
<a href="{{ url }}" class="grid grid-cols-3 gap-4 mb-4 group">
82-
<div class="aspect-ratio-youtube relative jamstacktv-card">
83-
<img src="{{ video.thumbnails.medium }}" alt="{{ video.title }}" class="jamstacktv-img absolute top-0 card-shadow bg-gradient-card-sunrise group-hover:card-shadow-sunrise">
81+
<a href="{{ url }}" class="mb-4 group jamstacktv-link">
82+
<div class="relative jamstacktv-card">
83+
<img src="{{ video.thumbnails.medium }}" alt="{{ video.title }}" class="jamstacktv-img card-shadow bg-gradient-card-sunrise group-hover:card-shadow-sunrise" width="480" height="360">
8484
<span class="jamstacktv-duration">{{{ displayStartInline }}}{{ displayDuration }}</span>
8585
{{{ scrubberHtml }}}
8686
</div>
87-
<div class="col-span-2 jamstacktv-item {{ wrapperClass }}">
87+
<div class="jamstacktv-item {{ wrapperClass }}">
8888
<div class="jamstacktv-meta mb-1">
8989
<span class="jamstacktv-category">{{#helpers.highlight}}{ "attribute": "playlist.title" }{{/helpers.highlight}}</span>
9090
<span class="jamstacktv-title">{{#helpers.highlight}}{ "attribute": "video.title" }{{/helpers.highlight}}</span>

src/site/tv.njk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ javascriptIncludes:
99
---
1010
{# This search index data is populated by the code at https://github.com/netlify/jamstack-tv-search-data #}
1111

12-
1312
<section class="md:mt-20">
1413
<h1 class="text-center">{{ title }}</h1>
1514
<p class="text-center">{{ subtitle }}</p>

0 commit comments

Comments
 (0)