-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Emotion] Convert
EuiBottomBar
to Emotion (#5823)
* Converted EuiBottomBar to Emotion and updated related EuiBottomBar jest tests * Updated EuiBottomBar tests to include the shouldRenderCustomStyles utility * Updated the EuiBottomBar component by making creating a new component that wraps the original inside of EuiThemeProvider to pass the dark theme to the entire component. Removed the shouldRenderCustomStyles test utility * Updated the EuiBottomBar props. Updated BottomBar snapshots * Handle PR comments and resolve a merge conflict in index.scss * Re-adding index.scss file chanes * Small PR change requests * Added documentation for colorMode specific component pattern creation * Update wiki/writing-styles-with-emotion.md Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update wiki/writing-styles-with-emotion.md Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
125 additions
and
63 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { css, keyframes } from '@emotion/react'; | ||
import { euiCanAnimate } from '../../global_styling'; | ||
import { UseEuiTheme, shade } from '../../services'; | ||
import { euiShadowFlat } from '../../themes/amsterdam/global_styling/mixins'; | ||
|
||
const euiBottomBarAppear = keyframes` | ||
0% { | ||
transform: translateY(100%); | ||
opacity: 0; | ||
} | ||
100% { | ||
transform: translateY(0%); | ||
opacity: 1; | ||
} | ||
`; | ||
|
||
export const euiBottomBarStyles = ({ euiTheme, colorMode }: UseEuiTheme) => ({ | ||
// Base | ||
// Text color needs to be reapplied to properly scope the forced `colorMode` | ||
euiBottomBar: css` | ||
${euiShadowFlat(euiTheme, undefined, colorMode)}; | ||
background: ${shade(euiTheme.colors.lightestShade, 0.5)}; | ||
color: ${euiTheme.colors.text}; | ||
${euiCanAnimate} { | ||
animation: ${euiBottomBarAppear} ${euiTheme.animation.slow} | ||
${euiTheme.animation.resistance}; | ||
} | ||
`, | ||
static: css``, | ||
fixed: css` | ||
z-index: ${Number(euiTheme.levels.header) - 2}; | ||
`, | ||
sticky: css` | ||
z-index: ${Number(euiTheme.levels.header) - 2}; | ||
`, | ||
// Padding | ||
s: css` | ||
padding: ${euiTheme.size.s}; | ||
`, | ||
m: css` | ||
padding: ${euiTheme.size.base}; | ||
`, | ||
l: css` | ||
padding: ${euiTheme.size.l}; | ||
`, | ||
none: '', | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**CSS-in-JS conversions** | ||
|
||
- Converted `EuiBottomBar` to Emotion |
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