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

DH/Improve navigation button style #678

Merged
merged 5 commits into from
Nov 16, 2023
Merged

Conversation

cmoinier
Copy link
Collaborator

@cmoinier cmoinier commented Nov 10, 2023

Description

This PR addresses the request to have a return button (in record page) that is easier to find. Some users struggle to find the current return button with a complex background image :

image(1)

After consulting Lucile it was decided to invert the button style, and have a white and transparent background and the text in back + a shadow.

image

Copy link
Contributor

github-actions bot commented Nov 10, 2023

Affected libs: ui-inputs, feature-dataviz, feature-record, feature-router, feature-editor, feature-search, feature-map, ui-elements, feature-catalog, ui-catalog, ui-search,
Affected apps: metadata-converter, metadata-editor, datahub, demo, webcomponents, search, datafeeder, map-viewer,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

@coveralls
Copy link

coveralls commented Nov 10, 2023

Coverage Status

coverage: 81.96% (-4.7%) from 86.617%
when pulling ab9e549 on DH/improve-record-page-return-btn
into 5f1c197 on main.

@jahow
Copy link
Collaborator

jahow commented Nov 10, 2023

Maybe we could also leverage https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode to make sure that buttons on top of any background are visible?

@jahow
Copy link
Collaborator

jahow commented Nov 10, 2023

There's also this which can be very useful: https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter

Wide spread support is still quite fresh but e.g. blurring the backdrop of an element is a great effect for readability.

@cmoinier
Copy link
Collaborator Author

@jahow Thanks for the suggestions! Last commit adds a shadow (it couldnt render in first commit) + the best mix-blend option I could find.

Backdrop-filter also looks interesting, but I don't think we can keep the shadow if we use this (both together look weird IMO). Having a shadow is quite important in case of very light/white backgrounds. What do you think?

@jahow
Copy link
Collaborator

jahow commented Nov 10, 2023

I tried using the backdrop blur and reworked the markup a bit:
Peek 10-11-2023 16-14

This is the markup that I used:

<button
  type="button"
  class="relative backdrop-blur group flex items-center justify-center p-1 text-white rounded overflow-hidden"
>
  <div
    class="absolute -z-0 inset-0 bg-primary opacity-40 group-hover:opacity-100 transition duration-[20ms]"
  ></div>
  <mat-icon class="z-0 material-symbols-outlined align-middle">{{
    icon
  }}</mat-icon>
  <span class="z-0 mx-2 hidden group-hover:inline">{{ label }}</span>
</button>

The backdrop that changes opacity is a separate element, the rest is always at full opacity. What do you think?

PS: I tried using the blend modes but it won't work all the time un less we do invert or something (which looks weird).

@jahow
Copy link
Collaborator

jahow commented Nov 10, 2023

Also I tried using the same technique on the badges below the search input and it looks ok I think?
image

BTW we should make sure to use the same component everywhere, currently there are three different kinds

@cmoinier
Copy link
Collaborator Author

With a pink-ish image in the background, it's hard to find though :
image

@jahow
Copy link
Collaborator

jahow commented Nov 10, 2023

Yes that's true.

@fgravin
Copy link
Member

fgravin commented Nov 11, 2023

Definitely backdrop-filter is great, it's what is used in Felt for the popups over the map, and the rendering is way better than just transparent.
backdrop-filter: blur(10px);

@fgravin
Copy link
Member

fgravin commented Nov 13, 2023

BTW, if anyone could animate the back to search button with a transition, it will be a nice 🎁
🤩

@fgravin fgravin self-assigned this Nov 15, 2023
@fgravin fgravin added the enhancement Proposal for a new feature label Nov 15, 2023
@fgravin fgravin added this to the 2.1.0 milestone Nov 15, 2023
@fgravin
Copy link
Member

fgravin commented Nov 15, 2023

I've made it simple, works well for Saint Dizier. I did not want to have a complete different button than the others (shadow, color etc...)
I've homogeneized transparent button

  • opacity 50
  • blur(8px)

image
image
image

@fgravin fgravin merged commit dad8beb into main Nov 16, 2023
6 checks passed
@fgravin fgravin deleted the DH/improve-record-page-return-btn branch November 16, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants