-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CSS-in-JS] Convert
EuiErrorBoundary
(#6053)
* convert euierrorboundary to styling via emotion * CL * use classNames * WIP: background-image * safari 15.4 repeating-linear-gradient fix
- Loading branch information
1 parent
5916088
commit 74edbd0
Showing
6 changed files
with
57 additions
and
21 deletions.
There are no files selected for viewing
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,31 @@ | ||
/* | ||
* 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 } from '@emotion/react'; | ||
import { logicalCSS } from '../../global_styling'; | ||
import { transparentize, UseEuiTheme } from '../../services'; | ||
|
||
export const euiErrorBoundaryStyles = ({ euiTheme }: UseEuiTheme) => { | ||
const color1 = transparentize(euiTheme.colors.danger, 0.25); | ||
const color2 = transparentize(euiTheme.colors.danger, 0.05); | ||
|
||
return { | ||
euiErrorBoundary: css` | ||
background-image: repeating-linear-gradient( | ||
45deg, | ||
${color1}, | ||
${color1} 1px, | ||
${color2} 1px, | ||
${color2} 19px | ||
); | ||
background-size: 54px 54px; // Fix for Safari 15.4+ | ||
${logicalCSS('padding-horizontal', euiTheme.size.base)}; | ||
${logicalCSS('padding-vertical', euiTheme.size.base)}; | ||
`, | ||
}; | ||
}; |
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 `EuiErrorBoundary` to Emotion |