@elastic/eui-theme-common 4.0.0 → 6.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.
Files changed (54) hide show
  1. package/lib/cjs/global_styling/functions/shadows.d.ts +12 -0
  2. package/lib/cjs/global_styling/functions/shadows.js +49 -4
  3. package/lib/cjs/global_styling/mixins/borders.d.ts +23 -0
  4. package/lib/cjs/global_styling/mixins/borders.js +50 -0
  5. package/lib/cjs/global_styling/mixins/index.d.ts +1 -0
  6. package/lib/cjs/global_styling/mixins/index.js +11 -0
  7. package/lib/cjs/global_styling/mixins/shadow.d.ts +22 -14
  8. package/lib/cjs/global_styling/mixins/shadow.js +142 -68
  9. package/lib/cjs/global_styling/variables/borders.d.ts +1 -1
  10. package/lib/cjs/global_styling/variables/components.d.ts +0 -1
  11. package/lib/cjs/global_styling/variables/flags.d.ts +2 -6
  12. package/lib/cjs/global_styling/variables/shadow.d.ts +52 -0
  13. package/lib/cjs/global_styling/variables/shadow.js +8 -2
  14. package/lib/cjs/global_styling/variables/typography.d.ts +1 -1
  15. package/lib/cjs/services/theme/types.d.ts +8 -1
  16. package/lib/cjs/services/vis_color_store.d.ts +3 -7
  17. package/lib/cjs/services/vis_color_store.js +4 -15
  18. package/lib/cjs/services/vis_color_store.test.js +1 -5
  19. package/lib/cjs/utils.d.ts +22 -1
  20. package/lib/cjs/utils.js +39 -1
  21. package/lib/cjs/utils.test.js +38 -0
  22. package/lib/esm/global_styling/functions/shadows.d.ts +12 -0
  23. package/lib/esm/global_styling/functions/shadows.js +40 -1
  24. package/lib/esm/global_styling/mixins/borders.d.ts +23 -0
  25. package/lib/esm/global_styling/mixins/borders.js +50 -0
  26. package/lib/esm/global_styling/mixins/index.d.ts +1 -0
  27. package/lib/esm/global_styling/mixins/index.js +1 -0
  28. package/lib/esm/global_styling/mixins/shadow.d.ts +22 -14
  29. package/lib/esm/global_styling/mixins/shadow.js +126 -81
  30. package/lib/esm/global_styling/variables/borders.d.ts +1 -1
  31. package/lib/esm/global_styling/variables/components.d.ts +0 -1
  32. package/lib/esm/global_styling/variables/flags.d.ts +2 -6
  33. package/lib/esm/global_styling/variables/shadow.d.ts +52 -0
  34. package/lib/esm/global_styling/variables/shadow.js +1 -0
  35. package/lib/esm/global_styling/variables/typography.d.ts +1 -1
  36. package/lib/esm/services/theme/types.d.ts +8 -1
  37. package/lib/esm/services/vis_color_store.d.ts +3 -7
  38. package/lib/esm/services/vis_color_store.js +3 -12
  39. package/lib/esm/services/vis_color_store.test.js +1 -5
  40. package/lib/esm/utils.d.ts +22 -1
  41. package/lib/esm/utils.js +31 -0
  42. package/lib/esm/utils.test.js +22 -1
  43. package/package.json +1 -1
  44. package/src/global_styling/mixins/_index.scss +0 -7
  45. package/src/global_styling/mixins/_states.scss +1 -1
  46. package/src/global_styling/variables/_index.scss +0 -1
  47. package/src/global_styling/mixins/_button.scss +0 -149
  48. package/src/global_styling/mixins/_form.scss +0 -272
  49. package/src/global_styling/mixins/_link.scss +0 -11
  50. package/src/global_styling/mixins/_loading.scss +0 -6
  51. package/src/global_styling/mixins/_panel.scss +0 -55
  52. package/src/global_styling/mixins/_range.scss +0 -59
  53. package/src/global_styling/mixins/_shadow.scss +0 -100
  54. package/src/global_styling/variables/_shadows.scss +0 -2
@@ -1,149 +0,0 @@
1
- // Provides a solid reset and base for handling sizing layout
2
- // Does not include any visual styles
3
- @mixin euiButtonBase {
4
- display: inline-block;
5
- appearance: none;
6
- cursor: pointer;
7
- height: $euiButtonHeight;
8
- line-height: $euiButtonHeight; // prevents descenders from getting cut off
9
- text-align: center;
10
- white-space: nowrap;
11
- max-width: 100%;
12
- vertical-align: middle;
13
- }
14
-
15
- // Adds the focus (and hover) animation for translating up 1px
16
- @mixin euiButtonFocus {
17
- @include euiCanAnimate {
18
- transition: transform $euiAnimSpeedNormal ease-in-out, background-color $euiAnimSpeedNormal ease-in-out;
19
-
20
- &:hover:not(:disabled) {
21
- transform: translateY(-1px);
22
- }
23
-
24
- &:focus {
25
- animation: euiButtonActive $euiAnimSpeedNormal $euiAnimSlightBounce;
26
- }
27
-
28
- &:active:not(:disabled) {
29
- transform: translateY(1px);
30
- }
31
- }
32
- }
33
-
34
- // All of the button base styles including the base, focus, font, and initial styles
35
- // Does not include individual alterations like color or sizes
36
- @mixin euiButton {
37
- @include euiButtonBase;
38
- @include euiFont;
39
- @include euiFontSize;
40
- @include euiButtonFocus;
41
-
42
- font-weight: $euiButtonFontWeight;
43
- text-decoration: none;
44
- outline-offset: -1px;
45
-
46
- &:hover:not(:disabled),
47
- &:focus {
48
- text-decoration: underline;
49
- }
50
- }
51
-
52
- // Correctly lays out the contents of a button when using the proper dom elements of:
53
- // <button>
54
- // <span className="__content">
55
- // {icon/spinner}
56
- // {child}
57
- // </span>
58
- // </button>
59
- // 1. Apply margin to all but last item in the flex.
60
- // 2. Margin gets flipped because of the row-reverse.
61
- @mixin euiButtonContent($isReverse: false) {
62
- height: 100%;
63
- width: 100%;
64
- vertical-align: middle;
65
-
66
- .euiButtonContent__icon,
67
- .euiButtonContent__spinner {
68
- flex-shrink: 0; // Ensures the icons/spinner don't scale down below their intended size
69
- }
70
-
71
- @if ($isReverse) {
72
- flex-direction: row-reverse;
73
-
74
- > * + * {
75
- margin-inline-start: 0; // 1, 2
76
- margin-inline-end: $euiSizeS; // 1, 2
77
- }
78
- } @else {
79
- display: flex;
80
- justify-content: center;
81
- align-items: center;
82
-
83
- > * + * {
84
- margin-inline-start: $euiSizeS; // 1
85
- }
86
- }
87
- }
88
-
89
- @mixin euiButtonContentDisabled {
90
- pointer-events: auto;
91
- cursor: not-allowed;
92
-
93
- &:hover,
94
- &:focus,
95
- &:focus-within {
96
- text-decoration: none;
97
- }
98
-
99
- .euiButtonContent__spinner {
100
- border-color: euiLoadingSpinnerBorderColors(currentColor);
101
- }
102
- }
103
-
104
- /*
105
- * Creates the Amsterdam style of button with a transparent background
106
- */
107
- @mixin euiButtonDefaultStyle($color: 'primary', $includeStates: true, $transparency: $euiButtonDefaultTransparency) {
108
- $backgroundColor: $color;
109
-
110
- @if (map-has-key($euiButtonTypes, $color)) {
111
- $backgroundColor: map-get($euiButtonTypes, $color);
112
- }
113
-
114
- $percentConversion: $transparency * 100%;
115
- // This variable simulates the possibly darkest background the button could be on
116
- // Simulates the 20% opaque color on top of the page background color
117
- $backgroundColorSimulated: mix($euiPageBackgroundColor, $backgroundColor, $percentConversion);
118
- // Then we can calculate the darkest text color needed
119
- color: makeHighContrastColor($backgroundColor, $backgroundColorSimulated);
120
- // But still use transparency
121
- background-color: transparentize($backgroundColor, $transparency);
122
-
123
- @if ($includeStates) {
124
- &:not([class*='isDisabled']) {
125
- &:hover,
126
- &:focus {
127
- // Duplicated from inert state simply to override default theme
128
- background-color: transparentize($backgroundColor, $transparency);
129
- }
130
- }
131
- }
132
- }
133
-
134
- /*
135
- * Creates the Amsterdam style of fill button
136
- */
137
- @mixin euiButtonFillStyle($color: 'primary') {
138
- $backgroundColor: $color;
139
-
140
- @if (map-has-key($euiButtonTypes, $color)) {
141
- $backgroundColor: map-get($euiButtonTypes, $color);
142
- }
143
-
144
- background-color: $backgroundColor;
145
- color: chooseLightOrDarkText($backgroundColor);
146
- }
147
-
148
- // Keyframe animation declarations can be found in
149
- // utility/animations.scss
@@ -1,272 +0,0 @@
1
- @mixin euiFormControlLayoutPadding($numOfIcons, $side: 'right', $compressed: false) {
2
- $iconSize: $euiSize;
3
- $iconPadding: $euiFormControlPadding;
4
- $marginBetweenIcons: $euiFormControlPadding / 2;
5
-
6
- @if ($compressed) {
7
- $iconPadding: $euiFormControlCompressedPadding;
8
- }
9
-
10
- @if variable-exists(numOfIcons) == false {
11
- @error '$numOfIcons:integer (1-3) must be provided to @mixin euiFormControlLayoutPadding().';
12
- } @else if $numOfIcons == 1 {
13
- padding-#{$side}: $iconPadding + $iconSize + $iconPadding;
14
- } @else if $numOfIcons == 2 {
15
- padding-#{$side}: $iconPadding + $iconSize + $marginBetweenIcons + $iconSize + $iconPadding;
16
- } @else if $numOfIcons == 3 {
17
- padding-#{$side}: $iconPadding + $iconSize + $marginBetweenIcons + $iconSize + $marginBetweenIcons + $iconSize + $iconPadding;
18
- }
19
- }
20
-
21
- @mixin euiPlaceholderPerBrowser {
22
- // stylelint-disable selector-no-vendor-prefix
23
- // Each prefix must be its own content block
24
- &::-webkit-input-placeholder { @content; opacity: 1; }
25
- &::-moz-placeholder { @content; opacity: 1; }
26
- &:-moz-placeholder { @content; opacity: 1; }
27
- &::placeholder { @content; opacity: 1; }
28
- }
29
-
30
- @function euiFormControlGradient($color: $euiColorPrimary) {
31
- @return linear-gradient(to top,
32
- $color,
33
- $color 2px,
34
- transparent 2px,
35
- transparent 100%
36
- );
37
- }
38
-
39
- @mixin euiFormControlText {
40
- @include euiFont;
41
- font-size: $euiFontSizeS;
42
- color: $euiColorTextParagraph;
43
-
44
- @include euiPlaceholderPerBrowser {
45
- color: $euiFormControlPlaceholderText;
46
- }
47
- }
48
-
49
- @mixin euiFormControlSize(
50
- $height: $euiFormControlHeight,
51
- $includeAlternates: false
52
- ) {
53
- // Default
54
- max-width: $euiFormMaxWidth;
55
- width: 100%;
56
- height: $height;
57
-
58
- @if ($includeAlternates) {
59
- &--fullWidth {
60
- max-width: 100%;
61
- }
62
-
63
- &--compressed {
64
- height: $euiFormControlCompressedHeight;
65
- }
66
-
67
- &--inGroup {
68
- height: 100%;
69
- }
70
- }
71
- }
72
-
73
- @mixin euiFormControlWithIcon($isIconOptional: false, $side: 'left', $compressed: false) {
74
- @if ($isIconOptional) {
75
- @at-root {
76
- #{&}--withIcon {
77
- @include euiFormControlLayoutPadding(1, $side, $compressed);
78
- }
79
- }
80
- } @else {
81
- @include euiFormControlLayoutPadding(1, $side, $compressed);
82
- }
83
- }
84
-
85
- @mixin euiFormControlIsLoading($isNextToIcon: false) {
86
- @at-root {
87
- #{&}-isLoading {
88
- @if ($isNextToIcon) {
89
- @include euiFormControlLayoutPadding(2);
90
- } @else {
91
- @include euiFormControlLayoutPadding(1);
92
- }
93
- }
94
-
95
- #{&}-isLoading#{&}--compressed {
96
- @if ($isNextToIcon) {
97
- @include euiFormControlLayoutPadding(2, $compressed: true);
98
- } @else {
99
- @include euiFormControlLayoutPadding(1, $compressed: true);
100
- }
101
- }
102
- }
103
- }
104
-
105
- // 1. Must supply both values to background-size or some browsers apply the single value to both directions
106
-
107
- @mixin euiFormControlDefaultShadow($borderOnly: false) {
108
- background-color: $euiFormBackgroundColor;
109
- background-repeat: no-repeat;
110
- background-size: 0% 100%; // 1
111
-
112
- @if ($borderOnly) {
113
- box-shadow: inset 0 0 0 1px $euiFormBorderColor;
114
- } @else {
115
- box-shadow:
116
- #{$euiFormControlBoxShadow},
117
- inset 0 0 0 1px $euiFormBorderColor;
118
- }
119
-
120
- transition:
121
- box-shadow $euiAnimSpeedFast ease-in,
122
- background-image $euiAnimSpeedFast ease-in,
123
- background-size $euiAnimSpeedFast ease-in,
124
- background-color $euiAnimSpeedFast ease-in;
125
-
126
- // Fixes bug in Firefox where adding a transition to the background-color
127
- // caused a flash of differently styled dropdown.
128
- @supports (-moz-appearance: none) {
129
- // List *must* be in the same order as the above.
130
- transition-property: box-shadow, background-image, background-size;
131
- }
132
- }
133
-
134
- @mixin euiFormControlFocusStyle($borderOnly: false) {
135
- background-color: tintOrShade($euiColorEmptyShade, 0%, 40%);
136
- background-image: euiFormControlGradient();
137
- background-size: 100% 100%; // 1
138
- outline: none; // Blanket remove all outlines relying on our own bottom border
139
-
140
- @if ($borderOnly) {
141
- box-shadow: inset 0 0 0 1px $euiFormBorderColor;
142
- } @else {
143
- box-shadow: inset 0 0 0 1px $euiFormBorderColor;
144
- }
145
- }
146
-
147
- @mixin euiFormControlInvalidStyle {
148
- background-image: euiFormControlGradient($euiColorDanger);
149
- background-size: 100%;
150
- }
151
-
152
- @mixin euiFormControlDisabledTextStyle {
153
- color: $euiFormControlDisabledColor;
154
- -webkit-text-fill-color: $euiFormControlDisabledColor; // Required for Safari
155
- }
156
-
157
- @mixin euiFormControlDisabledStyle {
158
- @include euiFormControlDisabledTextStyle;
159
- cursor: not-allowed;
160
- background: $euiFormBackgroundDisabledColor;
161
- box-shadow: inset 0 0 0 1px $euiFormBorderDisabledColor;
162
-
163
- @include euiPlaceholderPerBrowser {
164
- color: $euiFormControlDisabledColor;
165
- }
166
- }
167
-
168
- @mixin euiFormControlReadOnlyStyle {
169
- cursor: default;
170
- color: $euiColorTextParagraph;
171
- -webkit-text-fill-color: $euiColorTextParagraph; // Required for Safari
172
- // Use transparency since there is no border and in case form is on a non-white background
173
- background: $euiFormBackgroundReadOnlyColor;
174
- border-color: transparent;
175
- box-shadow: inset 0 0 0 1px $euiFormBorderDisabledColor;
176
- }
177
-
178
- // 2. Override invalid state with focus state.
179
-
180
- @mixin euiFormControlStyle($borderOnly: false, $includeStates: true, $includeSizes: true) {
181
- @include euiFormControlSize($includeAlternates: $includeSizes);
182
- @include euiFormControlDefaultShadow;
183
- @include euiFormControlText;
184
-
185
- border: none;
186
- border-radius: $euiFormControlBorderRadius;
187
- padding: $euiFormControlPadding;
188
-
189
- @if ($includeStates) {
190
- &:invalid { // 2
191
- @include euiFormControlInvalidStyle;
192
- }
193
-
194
- &:focus { // 2
195
- @include euiFormControlFocusStyle;
196
- }
197
-
198
- &:disabled {
199
- @include euiFormControlDisabledStyle;
200
- }
201
-
202
- &[readOnly] {
203
- @include euiFormControlReadOnlyStyle;
204
- }
205
-
206
- // Needs to be set for autofill
207
- &:-webkit-autofill {
208
- -webkit-text-fill-color: lightOrDarkTheme($euiColorDarkestShade, $euiColorLightShade);
209
-
210
- ~ .euiFormControlLayoutIcons {
211
- color: lightOrDarkTheme($euiColorDarkestShade, $euiColorLightShade);
212
- }
213
- }
214
- }
215
-
216
- @if ($includeSizes) {
217
- &--compressed {
218
- @include euiFormControlStyleCompressed($borderOnly, $includeStates);
219
- }
220
-
221
- &--inGroup {
222
- // stylelint-disable-next-line declaration-no-important
223
- box-shadow: none !important;
224
- border-radius: 0;
225
- }
226
- }
227
- }
228
-
229
- @mixin euiFormControlStyleCompressed($borderOnly: false, $includeStates: true) {
230
- @include euiFormControlDefaultShadow($borderOnly: true);
231
- padding: $euiFormControlCompressedPadding;
232
- border-radius: $euiFormControlCompressedBorderRadius;
233
-
234
- @if ($includeStates) {
235
- &:invalid { // 2
236
- @include euiFormControlInvalidStyle;
237
- }
238
-
239
- &:focus { // 2
240
- @include euiFormControlFocusStyle($borderOnly: true);
241
- }
242
-
243
- &:disabled {
244
- @include euiFormControlDisabledStyle;
245
- }
246
-
247
- &[readOnly] {
248
- @include euiFormControlReadOnlyStyle;
249
- }
250
- }
251
- }
252
-
253
- @mixin euiHiddenSelectableInput {
254
- position: absolute;
255
- // stylelint-disable-next-line declaration-no-important
256
- opacity: 0 !important; // Make sure it's still hidden when :disabled
257
- width: 100%;
258
- height: 100%;
259
- cursor: pointer;
260
- }
261
-
262
- // Adjusts form controls border radius
263
- @mixin euiFormControlSideBorderRadius($borderRadius, $side, $internal: false) {
264
- @if $internal == true {
265
- $borderRadius: $borderRadius - 1;
266
- }
267
- @if $side == 'left' {
268
- border-radius: $borderRadius 0 0 $borderRadius;
269
- } @else if $side == 'right' {
270
- border-radius: 0 $borderRadius $borderRadius 0;
271
- }
272
- }
@@ -1,11 +0,0 @@
1
- @mixin euiLink {
2
- text-align: left;
3
-
4
- &:hover {
5
- text-decoration: underline;
6
- }
7
-
8
- &:focus {
9
- text-decoration: underline;
10
- }
11
- }
@@ -1,6 +0,0 @@
1
- @function euiLoadingSpinnerBorderColors(
2
- $main: $euiColorLightShade,
3
- $highlight: $euiColorPrimary
4
- ) {
5
- @return $highlight $main $main $main;
6
- }
@@ -1,55 +0,0 @@
1
- @mixin euiPanel($selector) {
2
- @if variable-exists(selector) == false {
3
- @error 'A $selector must be provided to @mixin euiPanel().';
4
- } @else {
5
- #{$selector} {
6
- flex-grow: 1;
7
-
8
- &#{$selector}--flexGrowZero {
9
- flex-grow: 0;
10
- }
11
-
12
- &#{$selector}--hasShadow {
13
- @include euiBottomShadowMedium;
14
- }
15
-
16
- &#{$selector}--hasBorder {
17
- border: $euiBorderThin;
18
- box-shadow: none;
19
- }
20
-
21
- &#{$selector}--isClickable {
22
- // transition the shadow
23
- transition: all $euiAnimSpeedFast $euiAnimSlightResistance;
24
-
25
- &:enabled { // This is a good selector for buttons since it doesn't exist on divs
26
- // in case of button wrapper which inherently is inline-block and no width
27
- display: block;
28
- width: 100%;
29
- text-align: left;
30
- }
31
-
32
- &:hover,
33
- &:focus {
34
- @include euiBottomShadow;
35
- transform: translateY(-2px);
36
- cursor: pointer;
37
- }
38
- }
39
-
40
- // Border Radii
41
- @each $modifier, $amount in $euiPanelBorderRadiusModifiers {
42
- &#{$selector}--#{$modifier} {
43
- border-radius: $amount;
44
- }
45
- }
46
-
47
- // Background colors
48
- @each $modifier, $amount in $euiPanelBackgroundColorModifiers {
49
- &#{$selector}--#{$modifier} {
50
- background-color: $amount;
51
- }
52
- }
53
- }
54
- }
55
- }
@@ -1,59 +0,0 @@
1
- /*
2
- The CSS in JS version of this file lives in:
3
- - src/components/form/range/range.styles.ts
4
-
5
- The following files still use the Sass version:
6
- - src/themes/amsterdam/overrides/_color_stops.scss
7
- - src/themes/amsterdam/overrides/_hue.scss
8
- */
9
-
10
- @mixin euiRangeTrackSize($compressed: false) {
11
- height: $euiRangeTrackHeight;
12
- width: $euiRangeTrackWidth;
13
-
14
- @if ($compressed) {
15
- height: $euiRangeTrackCompressedHeight;
16
- }
17
- }
18
-
19
- @mixin euiRangeTrackPerBrowser {
20
- &::-webkit-slider-runnable-track { @content; }
21
- &::-moz-range-track { @content; }
22
- }
23
-
24
- @mixin euiRangeThumbBorder {
25
- border: 2px solid $euiRangeThumbBorderColor;
26
- }
27
-
28
- @mixin euiRangeThumbBoxShadow {
29
- box-shadow:
30
- 0 0 0 1px $euiRangeThumbBorderColor,
31
- 0 2px 2px -1px rgba($euiShadowColor, .2),
32
- 0 1px 5px -2px rgba($euiShadowColor, .2);
33
- }
34
-
35
- @mixin euiRangeThumbFocusBoxShadow {
36
- box-shadow: 0 0 0 2px $euiFocusRingColor;
37
- }
38
-
39
- @mixin euiRangeThumbStyle {
40
- @include euiRangeThumbBoxShadow;
41
- @include euiRangeThumbBorder;
42
- cursor: pointer;
43
- background-color: $euiRangeThumbBackgroundColor;
44
- padding: 0;
45
- height: $euiRangeThumbHeight;
46
- width: $euiRangeThumbWidth;
47
- box-sizing: border-box; // required for firefox or the border makes the width and height to increase
48
- }
49
-
50
- @mixin euiRangeThumbPerBrowser {
51
- &::-webkit-slider-thumb { @content; }
52
- &::-moz-range-thumb { @content; }
53
- }
54
-
55
- @mixin euiRangeThumbFocus {
56
- @include euiRangeThumbBorder;
57
- @include euiRangeThumbFocusBoxShadow;
58
- background-color: $euiColorPrimary;
59
- }
@@ -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
- }
@@ -1,2 +0,0 @@
1
- // Shadows
2
- $euiShadowColor: $euiColorInk !default;