-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Emotion] Convert EuiColorPickerSwatch (#7853)
- Loading branch information
Showing
8 changed files
with
70 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**CSS-in-JS conversions** | ||
|
||
- Converted `EuiColorPickerSwatch` 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
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
18 changes: 0 additions & 18 deletions
18
packages/eui/src/components/color_picker/_color_picker_swatch.scss
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
46 changes: 46 additions & 0 deletions
46
packages/eui/src/components/color_picker/color_picker_swatch.styles.ts
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,46 @@ | ||
/* | ||
* 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 { UseEuiTheme, transparentize } from '../../services'; | ||
import { | ||
logicalSizeCSS, | ||
mathWithUnits, | ||
euiOutline, | ||
} from '../../global_styling'; | ||
|
||
export const euiColorPickerSwatchStyles = (euiThemeContext: UseEuiTheme) => { | ||
const { euiTheme } = euiThemeContext; | ||
|
||
return { | ||
euiColorPickerSwatch: css` | ||
display: inline-block; | ||
${logicalSizeCSS(euiTheme.size.l)} | ||
border-radius: ${mathWithUnits( | ||
euiTheme.border.radius.medium, | ||
(x) => x / 2 | ||
)}; | ||
border: ${euiTheme.border.width.thin} solid | ||
${transparentize(euiTheme.colors.fullShade, 0.1)}; | ||
box-shadow: inset 0 0 0 ${euiTheme.border.width.thin} | ||
${transparentize(euiTheme.colors.emptyShade, 0.05)}; | ||
cursor: pointer; | ||
&:disabled { | ||
cursor: default; | ||
} | ||
/* Focus ring gets slightly cut off if not offset to the center */ | ||
&:focus { | ||
${euiOutline(euiThemeContext, 'center')} | ||
} | ||
`, | ||
}; | ||
}; |
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