-
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.
Merge branch 'emotion/color-pickers' into emotion/color-picker-5
- Loading branch information
Showing
20 changed files
with
462 additions
and
212 deletions.
There are no files selected for viewing
Binary file modified
BIN
-7 Bytes
(99%)
...chrome_desktop_Forms_EuiColorPalettePicker_EuiColorPalettePicker_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18 Bytes
(100%)
.../chrome_mobile_Forms_EuiColorPalettePicker_EuiColorPalettePicker_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,5 @@ | ||
**CSS-in-JS conversions** | ||
|
||
- Converted `EuiColorPalettePicker` and `EuiColorPaletteDisplay` to Emotion | ||
- Removed `$euiColorPaletteDisplaySizes` | ||
- Removed `@mixin euiColorPaletteInnerBorder` |
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,2 +0,0 @@ | ||
@import 'color_palette_picker/index'; | ||
@import 'color_palette_display/index'; | ||
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_palette_display/_color_palette_display.scss
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...s/eui/src/components/color_picker/color_palette_display/_color_palette_display_fixed.scss
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/eui/src/components/color_picker/color_palette_display/_index.scss
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
packages/eui/src/components/color_picker/color_palette_display/_mixins.scss
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
packages/eui/src/components/color_picker/color_palette_display/_variables.scss
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
...ges/eui/src/components/color_picker/color_palette_display/color_palette_display.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,54 @@ | ||
/* | ||
* 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 { logicalCSS } from '../../../global_styling'; | ||
|
||
export const euiColorPaletteDisplayStyles = (euiThemeContext: UseEuiTheme) => { | ||
const { euiTheme } = euiThemeContext; | ||
|
||
// Border is a pseudo element with transparency | ||
const border = `${euiTheme.border.width.thin} solid ${transparentize( | ||
euiTheme.colors.darkestShade, | ||
0.2 | ||
)}`; | ||
|
||
return { | ||
euiColorPaletteDisplay: css` | ||
position: relative; | ||
display: flex; | ||
flex-direction: row; | ||
overflow: hidden; | ||
&::after { | ||
content: ''; | ||
position: absolute; | ||
inset: 0; | ||
pointer-events: none; | ||
border: ${border}; | ||
border-radius: inherit; | ||
} | ||
`, | ||
|
||
// Sizes | ||
xs: css` | ||
${logicalCSS('height', euiTheme.size.xs)} | ||
border-radius: ${euiTheme.size.xs}; | ||
`, | ||
s: css` | ||
${logicalCSS('height', euiTheme.size.s)} | ||
border-radius: ${euiTheme.size.s}; | ||
`, | ||
m: css` | ||
${logicalCSS('height', euiTheme.size.base)} | ||
border-radius: ${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
20 changes: 20 additions & 0 deletions
20
...i/src/components/color_picker/color_palette_display/color_palette_display_fixed.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,20 @@ | ||
/* | ||
* 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'; | ||
|
||
// In a few screen sizes the palette display doesn't get a fully 100% width - | ||
// it gets 1px less on width. For this reason we're adding a horizontal 1px bleed area | ||
export const euiColorPaletteDisplayFixed__bleedArea = css` | ||
position: absolute; | ||
inset: 0; | ||
${logicalCSS('right', '-1px')} | ||
display: flex; | ||
`; |
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
Oops, something went wrong.