-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
components: Remove
@emotion/css
from ZStack (#33053)
* Remove `@emotion/css` from ZStack * Use a better name
- Loading branch information
1 parent
8533ca1
commit 6b6ac7b
Showing
2 changed files
with
25 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
// Disable reason: Temporarily disable for existing usages | ||
// until we remove them as part of https://github.com/WordPress/gutenberg/issues/30503#deprecating-emotion-css | ||
// eslint-disable-next-line no-restricted-imports | ||
import { css } from '@emotion/css'; | ||
import { css } from '@emotion/react'; | ||
import styled from '@emotion/styled'; | ||
|
||
export const ZStackView = styled.div` | ||
display: flex; | ||
position: relative; | ||
`; | ||
|
||
export const positionAbsolute = css` | ||
export const ZStackChildView = styled.div< { | ||
isLayered: boolean; | ||
offsetAmount: number; | ||
zIndex: number; | ||
} >` | ||
${ ( { isLayered, offsetAmount } ) => | ||
isLayered | ||
? css( { marginLeft: offsetAmount } ) | ||
: css( { right: offsetAmount * -1 } ) } | ||
${ ( { isLayered } ) => | ||
isLayered ? positionAbsolute : positionRelative } | ||
${ ( { zIndex } ) => css( { zIndex } ) } | ||
`; | ||
|
||
const positionAbsolute = css` | ||
position: absolute; | ||
`; | ||
|
||
export const positionRelative = css` | ||
const positionRelative = css` | ||
position: relative; | ||
`; |