Skip to content

Commit 5d8a572

Browse files
authored
Merge pull request #10 from bhagyamudgal/bhagyamudgal/fix-aspect-ratio-with-max-height
style: fix aspect ratio with max height
2 parents b915673 + d0581c4 commit 5d8a572

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
@tailwind utilities;
44

55
@layer base {
6+
.blink {
7+
container-type: inline-size;
8+
}
9+
610
.dial-light {
711
--blink-bg-primary: #ffffff;
812
--blink-button: #2a2a2b;

src/ui/ActionLayout.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,14 @@ export const ActionLayout = ({
182182
<div className={clsx('blink', stylePresetClassMap[stylePreset])}>
183183
<div className="w-full cursor-default overflow-hidden rounded-2xl border border-stroke-primary bg-bg-primary shadow-action">
184184
{image && (
185-
<Linkable url={websiteUrl} className="block px-5 pt-5">
185+
<Linkable
186+
url={websiteUrl}
187+
className="block max-h-[100cqw] overflow-y-hidden px-5 pt-5"
188+
>
186189
<img
187-
className={clsx('w-full rounded-xl object-cover object-left', {
188-
'aspect-square': !form,
189-
'aspect-[2/1]': form,
190-
})}
190+
className={clsx(
191+
'aspect-auto w-full rounded-xl object-cover object-center',
192+
)}
191193
src={image}
192194
alt="action-image"
193195
/>

0 commit comments

Comments
 (0)