Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Amsterdam] Remove borders from flyouts and popover arrows #3477

Merged
merged 20 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

- Removed `src-framer` files from the repository ([#3487](https://github.com/elastic/eui/pull/3487))

**Theme: Amsterdam**

- Updated shadow styles to improve smoothness, use black as the base color, and deprecated `opacity` value of shadow mixins. ([#3428](https://github.com/elastic/eui/pull/3428))
- Removed borders `EuiFlyout` and `EuiPopover` ([#3477](https://github.com/elastic/eui/pull/3477))

## [`24.0.0`](https://github.com/elastic/eui/tree/v24.0.0)

- Added `null` as acceptable `icon` prop for `EuiCard` ([#3470](https://github.com/elastic/eui/pull/3470))
Expand Down
8 changes: 5 additions & 3 deletions src/components/collapsible_nav/_collapsible_nav.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Extends euiFlyout
@use '../flyout/flyout';
@import '../flyout/variables';
@import '../flyout/mixins';

.euiCollapsibleNav {
@extend %eui-flyout;
@include euiFlyout;
border-left: none;
right: auto;
left: 0;
width: $euiCollapsibleNavWidth;
Expand All @@ -25,7 +27,7 @@

&,
&:focus {
// Override default `EuiButtonEmpty` :focus background to ensure better contrast
// Override default `EuiButtonEmpty` :focus background to ensure better contrast
background: $euiColorEmptyShade;
}
}
Expand Down
27 changes: 1 addition & 26 deletions src/components/flyout/_flyout.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
@import '../header/variables';

%eui-flyout {
border-left: $euiBorderThin;
// The mixin augments the above
// sass-lint:disable mixins-before-declarations
@include euiBottomShadowLarge($adjustBorders: true);
position: fixed;
top: 0;
bottom: 0;
right: 0;
height: 100%;
z-index: $euiZModal;
background: $euiColorEmptyShade;
display: flex;
flex-direction: column;
align-items: stretch;

// When the EuiHeader is fixed, we need to account for it in the position of the flyout
.euiBody--headerIsFixed & {
top: $euiHeaderHeightCompensation;
height: calc(100% - #{$euiHeaderHeightCompensation});
}
}

.euiFlyout {
@extend %eui-flyout;
@include euiFlyout;
animation: euiFlyout $euiAnimSpeedNormal $euiAnimSlightResistance;
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/flyout/_index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import 'variables';
@import 'mixins';

@import 'flyout';
@import 'flyout_body';
@import 'flyout_footer';
Expand Down
24 changes: 24 additions & 0 deletions src/components/flyout/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@import '../header/variables';

@mixin euiFlyout {
border-left: $euiFlyoutBorder;
// The mixin augments the above
// sass-lint:disable mixins-before-declarations
@include euiBottomShadowLarge($adjustBorders: true);
position: fixed;
top: 0;
bottom: 0;
right: 0;
height: 100%;
z-index: $euiZModal;
background: $euiColorEmptyShade;
display: flex;
flex-direction: column;
align-items: stretch;

// When the EuiHeader is fixed, we need to account for it in the position of the flyout
.euiBody--headerIsFixed & {
top: $euiHeaderHeightCompensation;
height: calc(100% - #{$euiHeaderHeightCompensation});
}
}
1 change: 1 addition & 0 deletions src/components/flyout/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$euiFlyoutBorder: $euiBorderThin !default;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$euiFlyoutBorder: none;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import 'buttons';
@import 'borders';
@import 'flyout';
@import 'typography';
@import 'shadows';
1 change: 1 addition & 0 deletions src/themes/eui-amsterdam/overrides/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import 'button';
@import 'button_empty';
@import 'button_group';
@import 'popover';
@import 'text';
59 changes: 59 additions & 0 deletions src/themes/eui-amsterdam/overrides/_popover.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.euiPopover__panel {
.euiPopover__panelArrow {
&:before {
@include internetExplorerOnly {
display: none;
}
johnbarrierwilson marked this conversation as resolved.
Show resolved Hide resolved
filter: blur($euiSizeXS - 1px);
opacity: .2;
}

$arrowShadowCompensation: $euiSizeXS;

&.euiPopover__panelArrow--top {
&:before {
bottom: -$euiPopoverArrowSize;
border-top-color: $euiShadowColor;
clip-path: polygon(-$arrowShadowCompensation 0, $euiPopoverArrowSize * 2 + $arrowShadowCompensation 0, $euiPopoverArrowSize * 2 + $arrowShadowCompensation $euiPopoverArrowSize + $arrowShadowCompensation, -$arrowShadowCompensation $euiPopoverArrowSize + $arrowShadowCompensation);
}

&:after {
bottom: -$euiPopoverArrowSize;
}
}

&.euiPopover__panelArrow--right {
&:before {
border-right-color: $euiShadowColor;
clip-path: polygon(-$arrowShadowCompensation #{-$arrowShadowCompensation}, $euiPopoverArrowSize #{-$arrowShadowCompensation}, $euiPopoverArrowSize $euiPopoverArrowSize * 2 + $arrowShadowCompensation, -$arrowShadowCompensation $euiPopoverArrowSize * 2 + $arrowShadowCompensation);
}

&:after {
left: -$euiPopoverArrowSize;
}
}

&.euiPopover__panelArrow--bottom {
&:before {
border-bottom-color: $euiShadowColor;
clip-path: polygon(-$arrowShadowCompensation #{-$arrowShadowCompensation}, $euiPopoverArrowSize * 2 + $arrowShadowCompensation #{-$arrowShadowCompensation}, $euiPopoverArrowSize * 2 + $arrowShadowCompensation $euiPopoverArrowSize, -$arrowShadowCompensation $euiPopoverArrowSize);
}

&:after {
top: -$euiPopoverArrowSize;
}
}

&.euiPopover__panelArrow--left {
&:before {
right: -$euiPopoverArrowSize;
border-left-color: $euiShadowColor;
clip-path: polygon(0 #{-$arrowShadowCompensation}, $euiPopoverArrowSize + $arrowShadowCompensation #{-$arrowShadowCompensation}, $euiPopoverArrowSize + $arrowShadowCompensation $euiPopoverArrowSize * 2 + $arrowShadowCompensation, 0 $euiPopoverArrowSize * 2 + $arrowShadowCompensation);
johnbarrierwilson marked this conversation as resolved.
Show resolved Hide resolved
}

&:after {
right: -$euiPopoverArrowSize;
}
}
}
}