-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[K8] [Maps] Fix toolbar overlay styles (#96352)
* Fix toolbar overlay styles * More styles * Updating test * Better focus state for mapbox buttons * Mapbox buttons focus * Focus againa * Focus states again * no background only for focus not hover * Adding mixin for button group border radius Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
22dd61d
commit ba091c0
Showing
10 changed files
with
152 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@mixin mapToolbarButtonGroupBorderRadius { | ||
@include kbnThemeStyle($theme: 'v7') { | ||
border-radius: $euiBorderRadius; | ||
} | ||
|
||
@include kbnThemeStyle($theme: 'v8') { | ||
border-radius: $euiBorderRadiusSmall; | ||
} | ||
|
||
overflow: hidden; | ||
} |
22 changes: 1 addition & 21 deletions
22
x-pack/plugins/maps/public/connected_components/toolbar_overlay/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,2 @@ | ||
@import 'tools_control/index'; | ||
|
||
.mapToolbarOverlay { | ||
position: absolute; | ||
top: ($euiSizeM + $euiSizeS) + ($euiSizeXL * 2); // Position and height of mapbox controls plus margin | ||
left: $euiSizeM; | ||
z-index: 2; // Sit on top of mapbox controls shadow | ||
} | ||
|
||
.mapToolbarOverlay__button { | ||
@include size($euiSizeXL); | ||
// sass-lint:disable-block no-important | ||
background-color: $euiColorEmptyShade !important; | ||
pointer-events: all; | ||
position: relative; | ||
|
||
&:enabled, | ||
&:enabled:hover, | ||
&:enabled:focus { | ||
@include euiBottomShadowLarge; | ||
} | ||
} | ||
@import 'toolbar_overlay'; |
49 changes: 49 additions & 0 deletions
49
x-pack/plugins/maps/public/connected_components/toolbar_overlay/_toolbar_overlay.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.mapToolbarOverlay { | ||
position: absolute; | ||
top: ($euiSizeM + $euiSizeS) + ($euiSizeXL * 2); // Position and height of mapbox controls plus margin | ||
left: $euiSizeM; | ||
z-index: 2; // Sit on top of mapbox controls shadow | ||
} | ||
|
||
.mapToolbarOverlay__button, | ||
.mapToolbarOverlay__buttonGroup { | ||
position: relative; | ||
transition: transform $euiAnimSpeedNormal ease-in-out, background $euiAnimSpeedNormal ease-in-out; | ||
|
||
@include kbnThemeStyle($theme: 'v7') { | ||
// Overrides the .euiPanel default border | ||
// sass-lint:disable-block no-important | ||
border: none !important; | ||
|
||
// Overrides the .euiPanel--hasShadow | ||
&.euiPanel.euiPanel--hasShadow { | ||
@include euiBottomShadowLarge; | ||
} | ||
} | ||
|
||
&:hover { | ||
transform: translateY(-1px); | ||
} | ||
|
||
// Removes the hover effect from the .euiButtonIcon because it would create a 1px bottom gap | ||
// So we put this hover effect into the panel that wraps the button or buttons | ||
.euiButtonIcon:hover { | ||
transform: translateY(0); | ||
} | ||
|
||
// Removes the focus background state because it can induce users to think these buttons are "enabled". | ||
// The buttons functionality are just applied once, so they shouldn't stay highlighted. | ||
.euiButtonIcon:focus:not(:hover) { | ||
background: none; | ||
} | ||
} | ||
|
||
.mapToolbarOverlay__buttonGroup { | ||
@include mapToolbarButtonGroupBorderRadius; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
.euiButtonIcon { | ||
border-radius: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 24 additions & 14 deletions
38
...nected_components/toolbar_overlay/tools_control/__snapshots__/tools_control.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters