From d4d5baf9d38cb5aa6f3e19afa961865c1e6e8f92 Mon Sep 17 00:00:00 2001 From: Caroline Horn <549577+cchaos@users.noreply.github.com> Date: Thu, 2 Aug 2018 17:34:54 -0400 Subject: [PATCH] Add defaults to borders and adjust shadows (#1079) --- src-docs/src/views/button/button_toggle.js | 5 ++++ src/components/flyout/_flyout.scss | 6 ++-- src/components/form/range/_range.scss | 2 +- src/components/modal/_modal.scss | 7 ++--- src/components/panel/_mixins.scss | 10 +++++-- .../__snapshots__/popover.test.js.snap | 10 +++---- src/components/popover/_popover.scss | 1 + src/components/popover/popover.js | 1 - src/components/toast/_toast.scss | 7 ++--- src/components/tool_tip/_tool_tip.scss | 2 +- src/global_styling/mixins/_shadow.scss | 29 ++++++++++++++----- src/global_styling/variables/_animations.scss | 14 ++++----- src/global_styling/variables/_borders.scss | 14 ++++----- src/global_styling/variables/_shadows.scss | 3 ++ 14 files changed, 65 insertions(+), 46 deletions(-) diff --git a/src-docs/src/views/button/button_toggle.js b/src-docs/src/views/button/button_toggle.js index 3abf1e712bb..e6772ee33fe 100644 --- a/src-docs/src/views/button/button_toggle.js +++ b/src-docs/src/views/button/button_toggle.js @@ -38,6 +38,7 @@ export default class extends Component { label="Toggle Me" iconType={this.state.toggle0On ? 'check' : 'cross'} onChange={this.onToggle0Change} + isSelected={this.state.toggle0On} /> @@ -46,6 +47,7 @@ export default class extends Component { label={this.state.toggle1On ? 'I\'m a filled toggle' : 'I\'m a primary toggle'} fill={this.state.toggle1On} onChange={this.onToggle1Change} + isSelected={this.state.toggle1On} /> @@ -54,6 +56,7 @@ export default class extends Component { label="Toggle Me" iconType={this.state.toggle4On ? 'eye' : 'eyeClosed'} onChange={this.onToggle4Change} + isSelected={this.state.toggle4On} isEmpty isIconOnly /> @@ -68,6 +71,7 @@ export default class extends Component { isDisabled label="Can't toggle this" fill={this.state.toggle2On} + isSelected={this.state.toggle2On} /> @@ -76,6 +80,7 @@ export default class extends Component { isDisabled label="Can't toggle this either" fill={this.state.toggle3On} + isSelected={this.state.toggle3On} /> ); diff --git a/src/components/flyout/_flyout.scss b/src/components/flyout/_flyout.scss index fcaf602f5df..72b34e768d6 100644 --- a/src/components/flyout/_flyout.scss +++ b/src/components/flyout/_flyout.scss @@ -1,12 +1,10 @@ -$euiFlyoutBorderColor: tintOrShade($euiShadowColorLarge, 50%, 0%) !default; // match shadow - .euiFlyout { - @include euiBottomShadowLarge; + border-left: $euiBorderThin; + @include euiBottomShadowLarge($adjustBorders: true); position: fixed; top: 0; bottom: 0; right: 0; - border-left: 1px solid $euiFlyoutBorderColor; z-index: $euiZModal; background: $euiColorEmptyShade; animation: euiFlyout $euiAnimSpeedNormal $euiAnimSlightResistance; diff --git a/src/components/form/range/_range.scss b/src/components/form/range/_range.scss index 7ff2b8c405a..bd29166258c 100644 --- a/src/components/form/range/_range.scss +++ b/src/components/form/range/_range.scss @@ -308,7 +308,7 @@ $euiRange__levelColors: ( } ~ .euiRange__valueWrapper .euiRange__value { - @include euiBottomShadow; + @include euiBottomShadowMedium; &.euiRange__value--right { transform: translateX(0) translateY(-50%) scale(1.1); diff --git a/src/components/modal/_modal.scss b/src/components/modal/_modal.scss index 7c82bb9dae8..543516fd203 100644 --- a/src/components/modal/_modal.scss +++ b/src/components/modal/_modal.scss @@ -1,18 +1,15 @@ -$euiModalBorderColor: tintOrShade($euiShadowColorLarge, 50%, 0%) !default; // match shadow - /** * 1. Fix IE overflow issue (min-height) by adding a separate wrapper for the * flex display. https://github.com/philipwalton/flexbugs#flexbug-3 */ .euiModal { - @include euiBottomShadowLarge; + border: $euiBorderThin; + @include euiBottomShadowLarge($adjustBorders: true); display: flex; /* 1 */ position: relative; background-color: $euiColorEmptyShade; - border: 1px solid $euiModalBorderColor; - border-top-color: tintOrShade($euiModalBorderColor, 50%, 0%); border-radius: $euiBorderRadius; z-index: $euiZModal; min-width: 50%; diff --git a/src/components/panel/_mixins.scss b/src/components/panel/_mixins.scss index ac5cafcf2e1..ea405741774 100644 --- a/src/components/panel/_mixins.scss +++ b/src/components/panel/_mixins.scss @@ -37,14 +37,18 @@ } &.#{$selector}--shadow { + @include euiBottomShadowMedium; + @if (lightness($euiTextColor) < 50) { - border-bottom-color: rgba($euiShadowColor, .6); + border-bottom-color: rgba($euiShadowColor, .5); + } @else { + // Applied again here in case dark theme overrides light + border-bottom-color: $euiBorderColor; } - @include euiBottomShadowMedium; &.#{$selector}--isClickable:hover, &.#{$selector}--isClickable:focus { - @include euiBottomShadow; + @include euiBottomShadow($color: $euiShadowColor, $opacity: .2); } } } diff --git a/src/components/popover/__snapshots__/popover.test.js.snap b/src/components/popover/__snapshots__/popover.test.js.snap index ce4b6885b54..029bfc1bca9 100644 --- a/src/components/popover/__snapshots__/popover.test.js.snap +++ b/src/components/popover/__snapshots__/popover.test.js.snap @@ -94,7 +94,7 @@ exports[`EuiPopover props isOpen renders true 1`] = `