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

[K8] [Maps] Fix toolbar overlay styles #96352

Merged
merged 12 commits into from
Apr 13, 2021

Conversation

elizabetdev
Copy link
Contributor

Summary

toolbar@2x

This PR is fixing:

  • No shadows in EuiButtonIcon in v8. This was fixed by wrapping the EuiButtonIcon in a EuiPanel.
  • Now we have better hover effects.
  • The top button Zoom In and Zoom Out are using mapbox buttons. The styles are now matching other buttons styles.
  • It was introduced styles to handle button groups. This could be used to add the new draw buttons that @aaronjcaldwell is working on. Basically to add a group of buttons we just need to:
<EuiPanel paddingSize="none" className="mapToolbarOverlay__buttonGroup">
  <EuiButtonIcon size="s"  iconType="node" />
  <EuiButtonIcon size="s"  iconType="mapMarker" />
</EuiPanel>

Checklist

@elizabetdev elizabetdev requested a review from a team as a code owner April 6, 2021 20:14
@elizabetdev elizabetdev added release_note:skip Skip the PR/issue when compiling release notes [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.13.0 labels Apr 6, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styles looks good, just one question wrt highlighting of the zoom +- and fit buttons.

is the highlighting effect supposed to be "sticky"
Apr-06-2021 17-51-15

e.g. the hover-effect remains applied for a little bit, causing sometimes multiple buttons to be highlighted at the same time or remain active "after clicking". e.g. this is not the case for the wrench or go-to button.

@kmartastic
Copy link
Contributor

e.g. the hover-effect remains applied for a little bit, causing sometimes multiple buttons to be highlighted at the same time or remain active "after clicking". e.g. this is not the case for the wrench or go-to button.

Good catch.

@elizabetdev
Copy link
Contributor Author

e.g. the hover-effect remains applied for a little bit, causing sometimes multiple buttons to be highlighted at the same time or remain active "after clicking". e.g. this is not the case for the wrench or go-to button.

The active "after clicking" is the :focus state. It means the button is focused. For the go-to and wrench it doesn't happen because both have a popover. So once you click the button and the popover opens the focus goes to the popover.

But I decided to remove the focus state from the buttons because it can induce to think that the button is "active". When using the keyboard the focus ring appears and for now, I think it's a good compromise.

We also need to think about the active states for when @aaronjcaldwell introduces the draw tools. They need to show that this "tool" is active. So I think when we reach that point we can revisit the focus and active states. 👍🏽

@kindsun
Copy link
Contributor

kindsun commented Apr 7, 2021

@elasticmachine merge upstream

@kindsun
Copy link
Contributor

kindsun commented Apr 7, 2021

Overall looking really good! I see the Fit data to bounds button doesn't darken on hover. Is this intentional?

image

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, @miukimiu! Left two small comments for your review.

Comment on lines 32 to 50
@include kbnThemeStyle($theme: 'v7') {
&:first-child {
border-radius: $euiBorderRadius $euiBorderRadius 0 0;
}

&:last-child {
border-radius: 0 0 $euiBorderRadius $euiBorderRadius;
}
}

@include kbnThemeStyle($theme: 'v8') {
&:first-child {
border-radius: ($euiBorderRadius * (2 / 3)) ($euiBorderRadius * (2 / 3)) 0 0;
}

&:last-child {
border-radius: 0 0 ($euiBorderRadius * (2 / 3)) ($euiBorderRadius * (2 / 3));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than styling the border-radius of these child buttons, could you instead remove these styles and just place an overflow: hidden; on the parent .mapboxgl-ctrl-group element? I believe that would achieve the same appearance with less SCSS. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MichaelMarcialis! Great suggestion. I already added. 👍🏽

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.6MB 2.6MB +3.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@elizabetdev elizabetdev merged commit ba091c0 into elastic:master Apr 13, 2021
elizabetdev added a commit that referenced this pull request Apr 13, 2021
* 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]>

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants