Skip to content

Commit

Permalink
fix aspect ratio in safari
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoskolodny committed Sep 19, 2023
1 parent 27af098 commit 6f1381b
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/card.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,20 +387,19 @@ export const vars = {aspectRatio};

export const cardContainer = style({
position: 'relative',
aspectRatio,
'@supports': {
'not (aspect-ratio: 1 / 1)': {
display: 'flex',
':before': {
float: 'left',
content: '""',
paddingTop: `calc(100% / ${aspectRatio})`,
},
':after': {
display: 'block',
content: '""',
clear: 'both',
},
},
},
...(aspectRatio
? {
display: 'flex',
':before': {
float: 'left',
content: '""',
paddingTop: `calc(100% / ${aspectRatio})`,
},
':after': {
display: 'block',
content: '""',
clear: 'both',
},
}
: {}),
});

0 comments on commit 6f1381b

Please sign in to comment.