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

Sticky close button #4825

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AntonKhorev
Copy link
Collaborator

@AntonKhorev AntonKhorev commented May 22, 2024

Allows close buttons to stay visible when sidebar contents is scrolled.

image image

image image

Fixes #2174.

Also related to this because the button is not inside sidebar_content and is not being resent with page templates.

@tordans
Copy link
Contributor

tordans commented May 22, 2024

I think we should update the design of the circle to make it more clear when scrolled. Maybe a light gray background (for non hover) with a white border for some separation to the background?

@AntonKhorev
Copy link
Collaborator Author

The circle doesn't have a hover state, it's not clickable. If I give it a gray background or a border it will look like clickable.

If you actually want the circle to be clickable, you want a larger close button. Do you want it? I didn't change the button size in this pull request.

@tordans
Copy link
Contributor

tordans commented May 25, 2024

The transparent background suggest that it is clickable as a whole element already. Changing it to behave like that would be an UX improvement to me, yes. And would also make the scrolled-state more clear.

@AntonKhorev
Copy link
Collaborator Author

AntonKhorev commented May 25, 2024

The transparent background suggest that it is clickable as a whole element already.

My goal was for the background was to suggest the opposite. It does two things:

  • makes the button more visible when it's displayed over other things
  • provides an unclickable separation between the button and other stuff

Changing it to behave like that would be an UX improvement to me, yes.

That doesn't have to do anything with sticky buttons. You want:

  • larger close buttons
  • different shape of close buttons: a circle with x inside instead of x

You can open another issues about that.

@tordans
Copy link
Contributor

tordans commented May 26, 2024

You can open another issues about that.

This PR makes the button sticky. I agree that the sticky button needs a visual separation to the content below. I don't think that it is good UX to make this area non-interactive (hover, click) – it's not what I would expect the interface to behave.

Unfortunately Bootstrap does not follow those UX decisions for their close button https://getbootstrap.com/docs/5.0/components/close-button/ (which only shows the non sticky version, but still…). However they do use a larger surface area for their burger menu https://getbootstrap.com/docs/5.0/components/navbar/#external-content which follows the same principle, IMO.

@AntonKhorev
Copy link
Collaborator Author

Unfortunately Bootstrap does not follow those UX decisions for their close button

If anyone wants larger close buttons, it's not difficult to do.
image

However they do use a larger surface area for their burger menu

Their burger button is similar to other outline buttons. You can remove border and padding if you want.
image

@AntonKhorev AntonKhorev added the ui User Interface label Jul 3, 2024
@AntonKhorev AntonKhorev force-pushed the sticky-close-button branch 2 times, most recently from fce2258 to 764f238 Compare January 22, 2025 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow closing side panels even when not scrolled all the way back to the top
2 participants