@elastic/eui-theme-common 3.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/global_styling/functions/shadows.d.ts +12 -0
- package/lib/cjs/global_styling/functions/shadows.js +49 -4
- package/lib/cjs/global_styling/mixins/borders.d.ts +23 -0
- package/lib/cjs/global_styling/mixins/borders.js +50 -0
- package/lib/cjs/global_styling/mixins/index.d.ts +1 -0
- package/lib/cjs/global_styling/mixins/index.js +11 -0
- package/lib/cjs/global_styling/mixins/shadow.d.ts +23 -14
- package/lib/cjs/global_styling/mixins/shadow.js +143 -68
- package/lib/cjs/global_styling/variables/flags.d.ts +1 -0
- package/lib/cjs/global_styling/variables/shadow.d.ts +52 -0
- package/lib/cjs/global_styling/variables/shadow.js +8 -2
- package/lib/cjs/global_styling/variables/typography.d.ts +1 -1
- package/lib/cjs/services/theme/types.d.ts +3 -1
- package/lib/cjs/utils.d.ts +22 -1
- package/lib/cjs/utils.js +39 -1
- package/lib/cjs/utils.test.js +38 -0
- package/lib/esm/global_styling/functions/shadows.d.ts +12 -0
- package/lib/esm/global_styling/functions/shadows.js +40 -1
- package/lib/esm/global_styling/mixins/borders.d.ts +23 -0
- package/lib/esm/global_styling/mixins/borders.js +50 -0
- package/lib/esm/global_styling/mixins/index.d.ts +1 -0
- package/lib/esm/global_styling/mixins/index.js +1 -0
- package/lib/esm/global_styling/mixins/shadow.d.ts +23 -14
- package/lib/esm/global_styling/mixins/shadow.js +127 -81
- package/lib/esm/global_styling/variables/flags.d.ts +1 -0
- package/lib/esm/global_styling/variables/shadow.d.ts +52 -0
- package/lib/esm/global_styling/variables/shadow.js +1 -0
- package/lib/esm/global_styling/variables/typography.d.ts +1 -1
- package/lib/esm/services/theme/types.d.ts +3 -1
- package/lib/esm/utils.d.ts +22 -1
- package/lib/esm/utils.js +31 -0
- package/lib/esm/utils.test.js +22 -1
- package/package.json +1 -1
- package/src/global_styling/mixins/_form.scss +0 -1
- package/src/global_styling/mixins/_index.scss +0 -1
- package/src/global_styling/mixins/_range.scss +0 -3
- package/src/global_styling/mixins/_typography.scss +0 -1
- package/src/global_styling/variables/_index.scss +0 -1
- package/src/global_styling/variables/_typography.scss +1 -68
- package/src/global_styling/mixins/_shadow.scss +0 -100
- package/src/global_styling/variables/_shadows.scss +0 -2
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ColorModeSwitch } from '../../services/theme/types';
|
|
1
3
|
export declare const EuiThemeShadowSizes: readonly ["xs", "s", "m", "l", "xl"];
|
|
2
4
|
export declare type _EuiThemeShadowSize = (typeof EuiThemeShadowSizes)[number];
|
|
5
|
+
export declare const EuiThemeShadowHoverSizes: readonly ["s", "m", "l", "xl", "xxl"];
|
|
6
|
+
export declare type _EuiThemeShadowHoverSize = (typeof EuiThemeShadowHoverSizes)[number];
|
|
3
7
|
/**
|
|
4
8
|
* Shadow t-shirt sizes descriptions
|
|
5
9
|
*/
|
|
@@ -9,3 +13,51 @@ export interface _EuiThemeShadowCustomColor {
|
|
|
9
13
|
property?: 'box-shadow' | 'filter';
|
|
10
14
|
borderAllInHighContrastMode?: boolean;
|
|
11
15
|
}
|
|
16
|
+
export declare type _EuiThemeShadow = {
|
|
17
|
+
/** Default direction of the shadow */
|
|
18
|
+
down: CSSProperties['boxShadow'];
|
|
19
|
+
/** Reverse direction */
|
|
20
|
+
up: CSSProperties['boxShadow'];
|
|
21
|
+
};
|
|
22
|
+
export declare type _EuiThemeShadows = ColorModeSwitch<{
|
|
23
|
+
colors: {
|
|
24
|
+
base: string;
|
|
25
|
+
};
|
|
26
|
+
xs: _EuiThemeShadow;
|
|
27
|
+
s: _EuiThemeShadow;
|
|
28
|
+
m: _EuiThemeShadow;
|
|
29
|
+
l: _EuiThemeShadow;
|
|
30
|
+
xl: _EuiThemeShadow;
|
|
31
|
+
hover: {
|
|
32
|
+
base: _EuiThemeShadow;
|
|
33
|
+
xl: _EuiThemeShadow;
|
|
34
|
+
};
|
|
35
|
+
/** @deprecated - Defined only to support the legacy `euiShadowFlat` mixin;
|
|
36
|
+
* will be removed in the future
|
|
37
|
+
*/
|
|
38
|
+
flat: _EuiThemeShadow;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Represents a single shadow
|
|
42
|
+
* @see https://tr.designtokens.org/format/#shadow
|
|
43
|
+
*/
|
|
44
|
+
export declare type _EuiThemeShadowLayer = {
|
|
45
|
+
opacity: number;
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
blur: number;
|
|
49
|
+
spread: number;
|
|
50
|
+
};
|
|
51
|
+
export declare type _EuiThemeShadowPrimitive = {
|
|
52
|
+
light: _EuiThemeShadowLayer[];
|
|
53
|
+
dark: _EuiThemeShadowLayer[];
|
|
54
|
+
};
|
|
55
|
+
export declare type _EuiThemeShadowPrimitives = {
|
|
56
|
+
xs: _EuiThemeShadowPrimitive;
|
|
57
|
+
s: _EuiThemeShadowPrimitive;
|
|
58
|
+
m: _EuiThemeShadowPrimitive;
|
|
59
|
+
l: _EuiThemeShadowPrimitive;
|
|
60
|
+
xl: _EuiThemeShadowPrimitive;
|
|
61
|
+
xxl: _EuiThemeShadowPrimitive;
|
|
62
|
+
flat: _EuiThemeShadowPrimitive;
|
|
63
|
+
};
|
|
@@ -84,7 +84,7 @@ export interface _EuiThemeTitle {
|
|
|
84
84
|
export declare type _EuiThemeFont = _EuiThemeFontBase & {
|
|
85
85
|
scale: _EuiThemeFontScales;
|
|
86
86
|
/**
|
|
87
|
-
* See {@link https://eui.elastic.co
|
|
87
|
+
* See {@link https://eui.elastic.co/docs/getting-started/theming/tokens/typography/font-weight/ | Reference} for more information
|
|
88
88
|
*/
|
|
89
89
|
weight: _EuiThemeFontWeights;
|
|
90
90
|
body: _EuiThemeBody;
|
|
@@ -7,6 +7,7 @@ import type { _EuiThemeColors } from '../../global_styling/variables/colors';
|
|
|
7
7
|
import type { _EuiThemeBase, _EuiThemeSizes } from '../../global_styling/variables/size';
|
|
8
8
|
import type { _EuiThemeFont } from '../../global_styling/variables/typography';
|
|
9
9
|
import type { _EuiThemeFocus } from '../../global_styling/variables/states';
|
|
10
|
+
import type { _EuiThemeShadows } from '../../global_styling/variables/shadow';
|
|
10
11
|
import type { _EuiThemeLevels } from '../../global_styling/variables/levels';
|
|
11
12
|
import type { _EuiThemeComponents } from '../../global_styling/variables/components';
|
|
12
13
|
import type { _EuiThemeFlags } from '../../global_styling/variables';
|
|
@@ -34,7 +35,7 @@ export declare type EuiThemeShapeBase = {
|
|
|
34
35
|
/** - Default value: 16 */
|
|
35
36
|
base: _EuiThemeBase;
|
|
36
37
|
/**
|
|
37
|
-
* See {@link https://eui.elastic.co
|
|
38
|
+
* See {@link https://eui.elastic.co/docs/getting-started/theming/tokens/sizing/ | Reference} for more information
|
|
38
39
|
*/
|
|
39
40
|
size: _EuiThemeSizes;
|
|
40
41
|
font: _EuiThemeFont;
|
|
@@ -43,6 +44,7 @@ export declare type EuiThemeShapeBase = {
|
|
|
43
44
|
animation: _EuiThemeAnimation;
|
|
44
45
|
breakpoint: _EuiThemeBreakpoints;
|
|
45
46
|
levels: _EuiThemeLevels;
|
|
47
|
+
shadows: _EuiThemeShadows;
|
|
46
48
|
components: _EuiThemeComponents;
|
|
47
49
|
flags: _EuiThemeFlags;
|
|
48
50
|
};
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EuiThemeColorMode, EuiThemeColorModeStandard, EuiThemeSystem, EuiThemeShape, EuiThemeComputed, EuiThemeHighContrastMode } from './global_styling';
|
|
1
|
+
import { EuiThemeColorMode, EuiThemeColorModeStandard, EuiThemeSystem, EuiThemeShape, EuiThemeComputed, _EuiThemeShadowLayer, EuiThemeHighContrastMode } from './global_styling';
|
|
2
2
|
export declare const DEFAULT_COLOR_MODE: "LIGHT";
|
|
3
3
|
/**
|
|
4
4
|
* Returns whether the provided color mode is `inverse`
|
|
@@ -104,3 +104,24 @@ export declare const mergeDeep: (_target: {
|
|
|
104
104
|
* and additional prefix/suffix
|
|
105
105
|
*/
|
|
106
106
|
export declare const getTokenName: (prefix: string, variant?: string | undefined, suffix?: string | undefined) => string;
|
|
107
|
+
/**
|
|
108
|
+
* Format an array of shadow "objects" into a string for CSS.
|
|
109
|
+
* The "up" direction is built by making the y offset from layers
|
|
110
|
+
* two and any subsequent layers, negative.
|
|
111
|
+
*
|
|
112
|
+
* It will add `inset` to the first layer when color mode is "DARK"
|
|
113
|
+
* and `spread` is 1, to ensure the dark mode-only floating border
|
|
114
|
+
* is rendered inside the container to match the position of the
|
|
115
|
+
* regular panel border (implemented with a pseudo element).
|
|
116
|
+
*
|
|
117
|
+
* @todo add a color space param to replace the hard-coded `hsl`
|
|
118
|
+
*
|
|
119
|
+
* @param layers
|
|
120
|
+
* @param options
|
|
121
|
+
* @param options.up - Modifies some values in order to get the "up" direction
|
|
122
|
+
* @returns - A value for the CSS `box-shadow` property
|
|
123
|
+
*/
|
|
124
|
+
export declare function formatMultipleBoxShadow(layers: _EuiThemeShadowLayer[], options?: {
|
|
125
|
+
direction?: 'down' | 'up';
|
|
126
|
+
color: string;
|
|
127
|
+
}): string;
|
package/lib/esm/utils.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
|
+
import chroma from 'chroma-js';
|
|
8
9
|
import { COLOR_MODES_STANDARD, COLOR_MODES_INVERSE, EUI_THEME_OVERRIDES_KEY, EUI_THEME_HIGH_CONTRAST_MODE_KEY, } from './global_styling';
|
|
9
10
|
export const DEFAULT_COLOR_MODE = COLOR_MODES_STANDARD.light;
|
|
10
11
|
/**
|
|
@@ -331,3 +332,33 @@ export const getTokenName = (prefix, variant, suffix) => {
|
|
|
331
332
|
const colorName = variant.charAt(0).toUpperCase() + variant.slice(1);
|
|
332
333
|
return `${prefix}${getCapitalized(colorName)}${_suffix}`;
|
|
333
334
|
};
|
|
335
|
+
/**
|
|
336
|
+
* Format an array of shadow "objects" into a string for CSS.
|
|
337
|
+
* The "up" direction is built by making the y offset from layers
|
|
338
|
+
* two and any subsequent layers, negative.
|
|
339
|
+
*
|
|
340
|
+
* It will add `inset` to the first layer when color mode is "DARK"
|
|
341
|
+
* and `spread` is 1, to ensure the dark mode-only floating border
|
|
342
|
+
* is rendered inside the container to match the position of the
|
|
343
|
+
* regular panel border (implemented with a pseudo element).
|
|
344
|
+
*
|
|
345
|
+
* @todo add a color space param to replace the hard-coded `hsl`
|
|
346
|
+
*
|
|
347
|
+
* @param layers
|
|
348
|
+
* @param options
|
|
349
|
+
* @param options.up - Modifies some values in order to get the "up" direction
|
|
350
|
+
* @returns - A value for the CSS `box-shadow` property
|
|
351
|
+
*/
|
|
352
|
+
export function formatMultipleBoxShadow(layers, options) {
|
|
353
|
+
if (layers.length === 0) {
|
|
354
|
+
return 'none';
|
|
355
|
+
}
|
|
356
|
+
const { direction = 'down', color = '#000' } = options ?? {};
|
|
357
|
+
/* prettier-ignore */
|
|
358
|
+
const shadowLayers = layers.map((layer, i) => {
|
|
359
|
+
const y = (direction === 'up' && i > 0) ? -layer.y : layer.y;
|
|
360
|
+
const shadowColor = chroma(color).alpha(layer.opacity).css('hsl');
|
|
361
|
+
return `${layer.x}px ${y}px ${layer.blur}px ${layer.spread}px ${shadowColor}`;
|
|
362
|
+
});
|
|
363
|
+
return shadowLayers.join(', ');
|
|
364
|
+
}
|
package/lib/esm/utils.test.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
|
-
import { isInverseColorMode, getColorMode, getOn, setOn, computed, Computed, getComputed, buildTheme, mergeDeep, getTokenName, } from './utils';
|
|
8
|
+
import { isInverseColorMode, getColorMode, getOn, setOn, computed, Computed, getComputed, buildTheme, mergeDeep, getTokenName, formatMultipleBoxShadow, } from './utils';
|
|
9
9
|
describe('isInverseColorMode', () => {
|
|
10
10
|
it("true only if 'inverse'", () => {
|
|
11
11
|
expect(isInverseColorMode('LIGHT')).toBe(false);
|
|
@@ -233,3 +233,24 @@ describe('getTokenName', () => {
|
|
|
233
233
|
expect(getTokenName('backgroundBase', 'primary', 'hovered')).toEqual('backgroundBasePrimaryHovered');
|
|
234
234
|
});
|
|
235
235
|
});
|
|
236
|
+
describe('formatMultipleBoxShadow', () => {
|
|
237
|
+
const layers = [
|
|
238
|
+
{ x: 0, y: 4, blur: 8, spread: 0, opacity: 0.1 },
|
|
239
|
+
{ x: 0, y: 2, blur: 4, spread: 0, opacity: 0.05 },
|
|
240
|
+
];
|
|
241
|
+
const options = {
|
|
242
|
+
color: '#000000',
|
|
243
|
+
};
|
|
244
|
+
it('returns a valid CSS box-shadow value', () => {
|
|
245
|
+
expect(formatMultipleBoxShadow(layers, options)).toEqual('0px 4px 8px 0px hsla(0,0%,0%,0.1), 0px 2px 4px 0px hsla(0,0%,0%,0.05)');
|
|
246
|
+
});
|
|
247
|
+
it('handles a single layer', () => {
|
|
248
|
+
expect(formatMultipleBoxShadow([layers[0]], options)).toEqual('0px 4px 8px 0px hsla(0,0%,0%,0.1)');
|
|
249
|
+
});
|
|
250
|
+
it('formats the "up" variant', () => {
|
|
251
|
+
expect(formatMultipleBoxShadow(layers, { ...options, direction: 'up' })).toEqual('0px 4px 8px 0px hsla(0,0%,0%,0.1), 0px -2px 4px 0px hsla(0,0%,0%,0.05)');
|
|
252
|
+
});
|
|
253
|
+
it('return "none" for no layers', () => {
|
|
254
|
+
expect(formatMultipleBoxShadow([], options)).toEqual('none');
|
|
255
|
+
});
|
|
256
|
+
});
|
package/package.json
CHANGED
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
// Each prefix must be its own content block
|
|
24
24
|
&::-webkit-input-placeholder { @content; opacity: 1; }
|
|
25
25
|
&::-moz-placeholder { @content; opacity: 1; }
|
|
26
|
-
&:-ms-input-placeholder { @content; opacity: 1; }
|
|
27
26
|
&:-moz-placeholder { @content; opacity: 1; }
|
|
28
27
|
&::placeholder { @content; opacity: 1; }
|
|
29
28
|
}
|
|
@@ -19,8 +19,6 @@ The following files still use the Sass version:
|
|
|
19
19
|
@mixin euiRangeTrackPerBrowser {
|
|
20
20
|
&::-webkit-slider-runnable-track { @content; }
|
|
21
21
|
&::-moz-range-track { @content; }
|
|
22
|
-
&::-ms-fill-lower { @content; }
|
|
23
|
-
&::-ms-fill-upper { @content; }
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
@mixin euiRangeThumbBorder {
|
|
@@ -52,7 +50,6 @@ The following files still use the Sass version:
|
|
|
52
50
|
@mixin euiRangeThumbPerBrowser {
|
|
53
51
|
&::-webkit-slider-thumb { @content; }
|
|
54
52
|
&::-moz-range-thumb { @content; }
|
|
55
|
-
&::-ms-thumb { @content; }
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
@mixin euiRangeThumbFocus {
|
|
@@ -1,75 +1,8 @@
|
|
|
1
1
|
// Families
|
|
2
|
-
$euiFontFamily: 'Inter', BlinkMacSystemFont, Helvetica, Arial, sans-serif !default;
|
|
3
2
|
$euiCodeFontFamily: 'Roboto Mono', Menlo, Courier, monospace !default;
|
|
4
3
|
|
|
5
4
|
// Careful using ligatures. Code editors like ACE will often error because of width calculations
|
|
6
5
|
$euiFontFeatureSettings: 'calt' 1, 'kern' 1, 'liga' 1 !default;
|
|
7
6
|
|
|
8
|
-
// Font sizes -- scale is loosely based on Major Third (1.250)
|
|
9
|
-
$euiTextScale: 2.25, 1.75, 1.25, 1.125, 1, .875, .75 !default;
|
|
10
|
-
|
|
11
|
-
$euiFontSize: $euiSize !default; // 5th position in scale
|
|
12
|
-
$euiFontSizeXS: $euiFontSize * nth($euiTextScale, 7) !default; // 12px
|
|
13
|
-
$euiFontSizeS: $euiFontSize * nth($euiTextScale, 6) !default; // 14px
|
|
14
|
-
$euiFontSizeM: $euiFontSize * nth($euiTextScale, 4) !default; // 18px
|
|
15
|
-
$euiFontSizeL: $euiFontSize * nth($euiTextScale, 3) !default; // 20px
|
|
16
|
-
$euiFontSizeXL: $euiFontSize * nth($euiTextScale, 2) !default; // 28px
|
|
17
|
-
$euiFontSizeXXL: $euiFontSize * nth($euiTextScale, 1) !default; // 36px
|
|
18
|
-
|
|
19
7
|
// Line height
|
|
20
|
-
$euiLineHeight: 1.5 !default;
|
|
21
|
-
$euiBodyLineHeight: 1 !default;
|
|
22
|
-
|
|
23
|
-
// Normally functions are imported before variables in `_index.scss` files
|
|
24
|
-
// But because they need to consume some typography variables they need to live here
|
|
25
|
-
@function convertToRem($size) {
|
|
26
|
-
@return #{$size / $euiFontSize}rem;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Our base gridline is at 1/2 the font-size, ensure line-heights stay on that gridline.
|
|
30
|
-
// EX: A proper line-height for text is 1.5 times the font-size.
|
|
31
|
-
// If our base font size (euiFontSize) is 16, our baseline is 8 (16*1.5 / 3). To ensure the
|
|
32
|
-
// text stays on the baseline, we pass a multiplier to calculate a line-height in rems.
|
|
33
|
-
@function lineHeightFromBaseline($multiplier: 3) {
|
|
34
|
-
@return convertToRem(($euiFontSize / 2) * $multiplier);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Titles map
|
|
38
|
-
// Lists all the properties per EuiTitle size that then gets looped through to create the selectors.
|
|
39
|
-
// The map allows for tokenization and easier customization per theme, otherwise you'd have to override the selectors themselves
|
|
40
|
-
$euiTitles: (
|
|
41
|
-
'xxxs': (
|
|
42
|
-
'font-size': $euiFontSizeXS,
|
|
43
|
-
'line-height': lineHeightFromBaseline(3),
|
|
44
|
-
'font-weight': $euiFontWeightBold,
|
|
45
|
-
),
|
|
46
|
-
'xxs': (
|
|
47
|
-
'font-size': $euiFontSizeS,
|
|
48
|
-
'line-height': lineHeightFromBaseline(3),
|
|
49
|
-
'font-weight': $euiFontWeightBold,
|
|
50
|
-
),
|
|
51
|
-
'xs': (
|
|
52
|
-
'font-size': $euiFontSize,
|
|
53
|
-
'line-height': lineHeightFromBaseline(3),
|
|
54
|
-
'font-weight': $euiFontWeightSemiBold,
|
|
55
|
-
'letter-spacing': -.02em,
|
|
56
|
-
),
|
|
57
|
-
's': (
|
|
58
|
-
'font-size': $euiFontSizeL,
|
|
59
|
-
'line-height': lineHeightFromBaseline(4),
|
|
60
|
-
'font-weight': $euiFontWeightMedium,
|
|
61
|
-
'letter-spacing': -.025em,
|
|
62
|
-
),
|
|
63
|
-
'm': (
|
|
64
|
-
'font-size': $euiFontSizeXL,
|
|
65
|
-
'line-height': lineHeightFromBaseline(5),
|
|
66
|
-
'font-weight': $euiFontWeightLight,
|
|
67
|
-
'letter-spacing': -.04em,
|
|
68
|
-
),
|
|
69
|
-
'l': (
|
|
70
|
-
'font-size': $euiFontSizeXXL,
|
|
71
|
-
'line-height': lineHeightFromBaseline(6),
|
|
72
|
-
'font-weight': $euiFontWeightLight,
|
|
73
|
-
'letter-spacing': -.03em,
|
|
74
|
-
),
|
|
75
|
-
) !default;
|
|
8
|
+
$euiLineHeight: 1.5 !default;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
@function shadowOpacity($opacity) {
|
|
2
|
-
@if (lightness($euiColorTextParagraph) < 50) {
|
|
3
|
-
@return $opacity * 1;
|
|
4
|
-
} @else {
|
|
5
|
-
@return $opacity * 2.5;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@mixin euiSlightShadow($color: $euiShadowColor) {
|
|
10
|
-
box-shadow:
|
|
11
|
-
0 .8px .8px rgba($color, shadowOpacity(.04)),
|
|
12
|
-
0 2.3px 2px rgba($color, shadowOpacity(.03));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@mixin euiBottomShadowSmall($color: $euiShadowColor) {
|
|
16
|
-
box-shadow:
|
|
17
|
-
0 .7px 1.4px rgba($color, shadowOpacity(.07)),
|
|
18
|
-
0 1.9px 4px rgba($color, shadowOpacity(.05)),
|
|
19
|
-
0 4.5px 10px rgba($color, shadowOpacity(.05));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@mixin euiBottomShadowMedium($color: $euiShadowColor) {
|
|
23
|
-
box-shadow:
|
|
24
|
-
0 .9px 4px -1px rgba($color, shadowOpacity(.08)),
|
|
25
|
-
0 2.6px 8px -1px rgba($color, shadowOpacity(.06)),
|
|
26
|
-
0 5.7px 12px -1px rgba($color, shadowOpacity(.05)),
|
|
27
|
-
0 15px 15px -1px rgba($color, shadowOpacity(.04));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Similar to shadow medium but without the bottom depth. Useful for popovers
|
|
31
|
-
// that drop UP rather than DOWN.
|
|
32
|
-
@mixin euiBottomShadowFlat($color: $euiShadowColor) {
|
|
33
|
-
box-shadow:
|
|
34
|
-
0 0 .8px rgba($color, shadowOpacity(.06)),
|
|
35
|
-
0 0 2px rgba($color, shadowOpacity(.04)),
|
|
36
|
-
0 0 5px rgba($color, shadowOpacity(.04)),
|
|
37
|
-
0 0 17px rgba($color, shadowOpacity(.03));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@mixin euiBottomShadow($color: $euiShadowColor) {
|
|
41
|
-
box-shadow:
|
|
42
|
-
0 1px 5px rgba($color, shadowOpacity(.1)),
|
|
43
|
-
0 3.6px 13px rgba($color, shadowOpacity(.07)),
|
|
44
|
-
0 8.4px 23px rgba($color, shadowOpacity(.06)),
|
|
45
|
-
0 23px 35px rgba($color, shadowOpacity(.05));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@mixin euiBottomShadowLarge(
|
|
49
|
-
$color: $euiShadowColor,
|
|
50
|
-
$opacity: 0,
|
|
51
|
-
$reverse: false
|
|
52
|
-
) {
|
|
53
|
-
@if ($reverse) {
|
|
54
|
-
box-shadow:
|
|
55
|
-
0 -2.7px 9px rgba($color, shadowOpacity(.13)),
|
|
56
|
-
0 -9.4px 24px rgba($color, shadowOpacity(.09)),
|
|
57
|
-
0 -21.8px 43px rgba($color, shadowOpacity(.08));
|
|
58
|
-
} @else {
|
|
59
|
-
box-shadow:
|
|
60
|
-
0 2.7px 9px rgba($color, shadowOpacity(.13)),
|
|
61
|
-
0 9.4px 24px rgba($color, shadowOpacity(.09)),
|
|
62
|
-
0 21.8px 43px rgba($color, shadowOpacity(.08));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// stylelint-disable color-named
|
|
67
|
-
@mixin euiOverflowShadow($direction: 'y', $side: 'both') {
|
|
68
|
-
$hideHeight: $euiScrollBarCornerThin * 1.25;
|
|
69
|
-
$gradient: null;
|
|
70
|
-
$gradientStart:
|
|
71
|
-
transparentize(red, .9) 0%,
|
|
72
|
-
transparentize(red, 0) $hideHeight;
|
|
73
|
-
$gradientEnd:
|
|
74
|
-
transparentize(red, 0) calc(100% - #{$hideHeight}),
|
|
75
|
-
transparentize(red, .9) 100%;
|
|
76
|
-
@if ($side == 'both' or $side == 'start' or $side == 'end') {
|
|
77
|
-
@if ($side == 'both') {
|
|
78
|
-
$gradient: $gradientStart, $gradientEnd;
|
|
79
|
-
} @else if ($side == 'start') {
|
|
80
|
-
$gradient: $gradientStart;
|
|
81
|
-
} @else {
|
|
82
|
-
$gradient: $gradientEnd;
|
|
83
|
-
}
|
|
84
|
-
} @else {
|
|
85
|
-
@warn "euiOverflowShadow() expects side to be 'both', 'start' or 'end' but got '#{$side}'";
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
@if ($direction == 'y') {
|
|
89
|
-
mask-image: linear-gradient(to bottom, #{$gradient});
|
|
90
|
-
} @else if ($direction == 'x') {
|
|
91
|
-
mask-image: linear-gradient(to right, #{$gradient});
|
|
92
|
-
} @else {
|
|
93
|
-
@warn "euiOverflowShadow() expects direction to be 'y' or 'x' but got '#{$direction}'";
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Chrome+Edge has a very bizarre edge case bug where `mask-image` stops working
|
|
97
|
-
// This workaround forces a stacking context on the scrolling container, which
|
|
98
|
-
// hopefully addresses the bug. @see https://github.com/elastic/eui/pull/7855
|
|
99
|
-
transform: translateZ(0);
|
|
100
|
-
}
|