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 all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

- Removed borders `EuiModal` ([#3515](https://github.com/elastic/eui/pull/3515))
- Improve `EuiOverlayMask` colors ([#3515](https://github.com/elastic/eui/pull/3515))
- 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 from `EuiFlyout` and `EuiPopover` ([#3477](https://github.com/elastic/eui/pull/3477))

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

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
Expand Up @@ -4,4 +4,5 @@
@import 'image';
@import 'modal';
@import 'overlay_mask';
@import 'popover';
@import 'text';
56 changes: 56 additions & 0 deletions src/themes/eui-amsterdam/overrides/_popover.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.euiPopover__panel {
.euiPopover__panelArrow {
&:before {
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 + 1;
}
}

&.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 + 1;
}
}

&.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 + 1;
}
}

&.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});
}

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