Skip to content

Commit

Permalink
fix(base): fix usage of inset property (#2769)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjelfull committed Sep 13, 2021
1 parent 9ba888c commit 3448ee7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
10 changes: 8 additions & 2 deletions packages/@sanity/base/src/components/previews/defaultPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const MediaWrapper = styled(Flex)`
& img {
position: absolute;
inset: 0;
left: 0;
top: 0;
right: 0;
bottom: 0;
object-fit: cover;
border-radius: inherit;
}
Expand All @@ -35,7 +38,10 @@ const MediaWrapper = styled(Flex)`
& img + span {
display: block;
position: absolute;
inset: 0 0 0 0;
left: 0;
top: 0;
right: 0;
bottom: 0;
box-shadow: inset 0 0 0 1px var(--card-fg-color);
opacity: 0.2;
border-radius: inherit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import styled from 'styled-components'

export const MediaWrapper = styled(Flex)`
position: absolute !important;
inset: 0;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: var(--card-hairline-hard-color);
border-radius: ${({theme}) => rem(theme.sanity.radius[2])};
Expand All @@ -17,16 +20,17 @@ export const MediaWrapper = styled(Flex)`
&::after {
content: '';
position: absolute;
inset: 0;
left: 0;
top: 0;
right: 0;
bottom: 0;
box-shadow: inset 0 0 0 1px var(--card-shadow-umbra-color);
border-radius: ${({theme}) => rem(theme.sanity.radius[2])};
}
`

export const Root = styled(Box)`
position: relative;
overflow: hidden;
flex-grow: 1;
`

export const MediaString = styled(Flex)`
Expand All @@ -39,7 +43,10 @@ export const MediaString = styled(Flex)`

export const ProgressWrapper = styled(Flex)`
position: absolute;
inset: 0;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
> * {
Expand All @@ -51,7 +58,11 @@ export const ProgressWrapper = styled(Flex)`
background-color: var(--card-bg-color);
opacity: 0.7;
content: '';
display: block;
position: absolute;
inset: 0;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
`

2 comments on commit 3448ee7

@vercel
Copy link

@vercel vercel bot commented on 3448ee7 Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio.sanity.build
test-studio-git-next.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 3448ee7 Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

perf-studio – ./

perf-studio-git-next.sanity.build
perf-studio.sanity.build

Please sign in to comment.