Skip to content

Commit 8657072

Browse files
fix the card responsive issue
1 parent c04e52c commit 8657072

File tree

1 file changed

+39
-29
lines changed

1 file changed

+39
-29
lines changed

partials/card.hbs

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
<div
2-
class="my-12 mx-auto relative grid bg-clip-border rounded-xl bg-white text-gray-700 shadow-md w-full max-w-[26rem] sm:max-w-[34rem] md:max-w-[42rem] lg:max-w-[56rem] grid-cols-2 md:grid-cols-4">
1+
<div class="mx-auto max-w-[25rem] sm:max-w-[38rem] md:max-w-[42rem] lg:max-w-[56rem] my-12 md:mx-auto grid bg-clip-border rounded-xl bg-white text-gray-700 shadow-md w-full grid-cols-2 lg:grid-cols-4">
32

4-
<div
5-
class="col-span-2 justify-self-auto relative m-0 overflow-hidden text-gray-700 bg-white rounded-r-none bg-clip-border rounded-xl shrink-0">
3+
<div class="rounded-none lg:rounded-r-none md:h-[364px] col-span-2 justify-self-auto relative m-0 overflow-hidden bg-clip-border lg:rounded-xl shrink-0">
64

75
<img srcset="{{img_url feature_image size=" s"}} 300w, {{img_url feature_image size="m" }} 600w, {{img_url
86
feature_image size="l" }} 1000w, {{img_url feature_image size="xl" }} 2000w"
@@ -11,16 +9,17 @@
119

1210
</div>
1311

14-
<div class="p-6 col-span-2 md:col-start-3 md:col-end-5">
12+
<div class="p-6 col-span-2 flex flex-col justify-center lg:col-start-3 lg:col-end-5 ">
1513

16-
<div class="flex flex-row justify-between">
14+
<div class="flex row-span-2 flex-row justify-between">
1715

18-
<h6
19-
class="block mb-4 font-sans text-base antialiased font-semibold leading-relaxed tracking-normal text-gray-700 uppercase">
20-
{{tags}}
21-
</h6>
16+
{{#if primary_tag}}
17+
<a href="{{url}}"
18+
class="block mb-4 font-sans text-base antialiased font-semibold leading-relaxed tracking-normal text-gray-700 uppercase">{{primary_tag.name}}</a>
19+
{{/if}}
2220

2321
{{#unless access}}
22+
2423
{{#has visibility="members"}}
2524
<h6
2625
class="block mb-4 font-sans text-base antialiased font-semibold leading-relaxed tracking-normal text-gray-700 uppercase">
@@ -32,51 +31,62 @@
3231
Paid Members only
3332
</h6>
3433
{{/has}}
34+
3535
{{/unless}}
3636

3737
</div>
3838

39-
<h4 class="block mb-2 font-sans text-2xl antialiased font-semibold leading-snug tracking-normal text-blue-gray-900">
40-
{{title}}
41-
</h4>
42-
<p class="block mb-8 font-sans text-base antialiased font-normal leading-relaxed text-gray-700">
43-
{{excerpt words="100"}}
44-
</p>
39+
<div class="flex row-span-3 flex-col">
40+
<h4 class="mb-2 font-sans text-2xl antialiased font-semibold leading-snug tracking-normal text-blue-gray-900">
41+
{{title}}
42+
</h4>
43+
44+
<p class="mb-8 font-sans text-base antialiased font-normal leading-relaxed text-gray-700">
45+
{{excerpt words="30"}}
46+
</p>
47+
</div>
4548

46-
<div class="flex flex-row justify-between items-center">
49+
<div class="flex row-span-4 flex-row justify-between items-center">
4750

51+
{{!-- author for large screen --}}
4852
<div class="hidden sm:flex items-center space-x-4">
53+
4954
<img src="{{primary_author.profile_image}}" alt="{{primary_author.name}}"
5055
class="w-10 h-10 rounded-full dark:bg-gray-500" />
51-
<div>
52-
53-
<a href="{{primary_author.url}}">
56+
57+
<div class="flex flex-col justify-center items-center">
58+
59+
<a class="w-full" href="{{primary_author.url}}">
5460
<h3 class="text-sm font-medium">{{primary_author.name}}</h3>
5561
</a>
5662

57-
<time datetime="{{date format='YYYY-MM-DD'}}" class="text-sm dark:text-gray-400">{{date format="DD MMMM
58-
YYYY"}}</time>
63+
<time datetime="{{date format='YYYY-MM-DD'}}" class="text-sm dark:text-gray-400">
64+
{{date format="DD MMMM YYYY"}}
65+
</time>
66+
5967
</div>
6068

69+
6170
</div>
6271

72+
{{!-- author for small --}}
6373
<a class="block sm:hidden" href="{{primary_author.url}}">
6474
<h3 class="text-sm font-medium">{{primary_author.name}}</h3>
6575
</a>
6676

67-
<a href="{{url}}" class="inline-block">
77+
<a href="{{url}}" class="flex items-center gap-2 px-2.5 py-1 font-sans text-xs font-bold text-center text-gray-900 uppercase align-middle transition-all rounded-lg select-none disabled:opacity-50 disabled:shadow-none disabled:pointer-events-none hover:bg-gray-900/10 active:bg-gray-900/20">
6878

69-
<button
70-
class="flex items-center gap-2 px-6 py-3 font-sans text-xs font-bold text-center text-gray-900 uppercase align-middle transition-all rounded-lg select-none disabled:opacity-50 disabled:shadow-none disabled:pointer-events-none hover:bg-gray-900/10 active:bg-gray-900/20"
71-
type="button">
72-
Learn More<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"
73-
stroke-width="2" class="w-4 h-4">
79+
Learn More
80+
81+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"
82+
class="w-4 h-4">
7483
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3"></path>
7584
</svg>
76-
</button>
7785

7886
</a>
87+
7988
</div>
8089

8190
</div>
91+
8292
</div>

0 commit comments

Comments
 (0)