Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
style: responsive image scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
TuukkaIkius committed Jan 24, 2024
1 parent b59a6d2 commit 6e97cbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions components/DropdownMenu/DropdownMenuItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ max-width: min-content;
justify-content: flex-start;
flex-direction: row;
border: 1px solid #F0F2F4;
overflow: hidden;
min-height: 140px;
width: 100%;
min-width: unset;
Expand All @@ -59,26 +60,35 @@ max-width: min-content;
}
}
.imageBox {
width:100%;
width:250px;
height:100%;
max-width: 250px;
flex-shrink: 0;
align-self: center;
position: relative;
&:img {
position: relative;
object-fit: cover;
@media (--lg-scr) {
flex-shrink: 1;
}
}

.imageBox img {
position: relative;
object-fit: cover;
width: 100%;
height: 100%;
}
.item {
margin-left: 8px;
color: var(--color-code);
@media (--nav) {
margin-left: 16px;
}
&.moreMargin {
&.imageitemText {
margin-top: 12px;
margin-bottom: 12px;
@media (--nav) {
min-width: 40%;
max-width: 50%;
}
}
}
.itemTitle {
Expand Down
2 changes: 1 addition & 1 deletion components/DropdownMenu/DropdownMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const DropdownMenuItem = ({
alt=""
/>
</div>
<div className={cn(styles.item, styles.moreMargin)} {...props}>
<div className={cn(styles.item, styles.imageItemText)} {...props}>
<p className={styles.imageItemTitle}>{customImage?.itemTitle}</p>
{customImage?.imageDate && (
<p className={styles.dateText}>{customImage?.imageDate}</p>
Expand Down

0 comments on commit 6e97cbd

Please sign in to comment.