-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[components] Improve dialog and popover components
- Loading branch information
1 parent
5fb6e58
commit eb10d2b
Showing
5 changed files
with
208 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 41 additions & 52 deletions
93
packages/@sanity/components/src/edititem/EditItemFoldOut.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,90 @@ | ||
@import 'part:@sanity/base/theme/variables-style'; | ||
|
||
:root { | ||
--edit-item-fold-border-color: var(--brand-primary); | ||
--edit-item-fold-dark-color: color(var(--edit-item-fold-border-color) lightness(- 20%)); | ||
--edit-item-fold-padding: var(--medium-padding); | ||
} | ||
|
||
:export { | ||
padding: var(--edit-item-fold-padding); | ||
} | ||
|
||
@keyframes appear { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
.root { | ||
position: relative; | ||
display: block; | ||
width: 100%; | ||
|
||
z-index: var(--zindex-portal); | ||
} | ||
|
||
.wrapper { | ||
.card { | ||
composes: shadow-12dp from 'part:@sanity/base/theme/shadows-style'; | ||
box-sizing: border-box; | ||
border: 1px solid var(--edit-item-fold-border-color); | ||
background-color: var(--component-bg); | ||
border-radius: 0 0 var(--border-radius-base) var(--border-radius-base); | ||
margin-left: calc(var(--edit-item-fold-padding) * -1); | ||
margin-right: calc(var(--edit-item-fold-padding) * -1); | ||
margin-left: calc(var(--small-padding) * -1); | ||
margin-right: calc(var(--small-padding) * -1); | ||
width: calc(100% + var(--small-padding) * 2); | ||
border-radius: 0 0 var(--border-radius-medium) var(--border-radius-medium); | ||
max-height: 50vh; | ||
position: relative; | ||
animation: appear 0.2s linear; | ||
width: calc(100% + var(--edit-item-fold-padding) * 2); | ||
display: flex; | ||
flex-direction: column; | ||
|
||
@nest &::after { | ||
content: ''; | ||
box-sizing: content-box; | ||
display: block; | ||
position: absolute; | ||
top: calc(var(--edit-item-fold-padding) * -1); | ||
top: calc((var(--small-padding) * -1) - 1px); | ||
left: 0; | ||
height: 0; | ||
width: 0; | ||
margin-left: -1px; | ||
margin-top: -1px; | ||
border-color: transparent; | ||
border-bottom: var(--edit-item-fold-padding) solid var(--edit-item-fold-dark-color); | ||
border-left: var(--edit-item-fold-padding) solid transparent; | ||
border-bottom: calc(var(--small-padding) + 1px) solid var(--hairline-color); | ||
border-left: calc(var(--small-padding) + 1px) solid transparent; | ||
z-index: -1; | ||
} | ||
|
||
@nest &::before { | ||
content: ''; | ||
box-sizing: content-box; | ||
display: block; | ||
position: absolute; | ||
top: calc(var(--edit-item-fold-padding) * -1); | ||
top: calc((var(--small-padding) * -1) - 1px); | ||
right: 0; | ||
height: 0; | ||
width: 0; | ||
margin-right: -1px; | ||
margin-top: -1px; | ||
border-color: transparent; | ||
border-bottom: var(--edit-item-fold-padding) solid var(--edit-item-fold-dark-color); | ||
border-right: var(--edit-item-fold-padding) solid transparent; | ||
border-bottom: calc(var(--small-padding) + 1px) solid var(--hairline-color); | ||
border-right: calc(var(--small-padding) + 1px) solid transparent; | ||
z-index: -1; | ||
} | ||
} | ||
|
||
.head { | ||
background-color: var(--edit-item-fold-border-color); | ||
padding: var(--small-padding); | ||
height: 1.5em; | ||
color: var(--white); | ||
.header { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
|
||
@nest &::after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
bottom: -1px; | ||
border-bottom: 1px solid var(--hairline-color); | ||
z-index: 1; | ||
} | ||
} | ||
|
||
.close { | ||
pointer-events: auto; | ||
outline: none; | ||
color: var(--white); | ||
display: block; | ||
border: none; | ||
background-color: transparent; | ||
float: right; | ||
.header__title { | ||
flex: 1; | ||
min-width: 0; | ||
margin: -2px 0 -1px; | ||
font-weight: 600; | ||
padding: var(--medium-padding); | ||
} | ||
|
||
.closeDark { | ||
composes: close; | ||
color: var(--black); | ||
.header__actions { | ||
padding: var(--small-padding); | ||
} | ||
|
||
.content { | ||
flex: 1; | ||
min-height: 0; | ||
padding: var(--medium-padding); | ||
overflow: auto; | ||
} |
Oops, something went wrong.