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

Not enough space between navbar icon buttons #81

Closed
Tracked by #72
gabalafou opened this issue May 28, 2024 · 4 comments
Closed
Tracked by #72

Not enough space between navbar icon buttons #81

gabalafou opened this issue May 28, 2024 · 4 comments
Assignees
Labels

Comments

@gabalafou
Copy link
Contributor

No description provided.

@gabalafou
Copy link
Contributor Author

I don't need a Figma to implement this, but I think it would be great if somebody in design could tell me by exactly how much I should increase the space between navbar icon buttons, and then I'll implement it.

@gabalafou gabalafou changed the title Not enough space between navbar icon buttons [S] Not enough space between navbar icon buttons May 28, 2024
@gabalafou gabalafou moved this from 📬 TODO to Design in czi-scientific-python 🐍 May 31, 2024
@gabalafou gabalafou added the size: S A few hours, less than one week label May 31, 2024
@gabalafou gabalafou changed the title [S] Not enough space between navbar icon buttons Not enough space between navbar icon buttons May 31, 2024
@isabela-pf isabela-pf self-assigned this May 31, 2024
@isabela-pf isabela-pf moved this from Design to 🏗 In progress in czi-scientific-python 🐍 Jun 3, 2024
@isabela-pf
Copy link

Too long; didn't read: I would recommend we implement an additional 2.5 CSS pixels (or change the`column-gap value from 1rem to 1.1–1.12 rems) between navbar icon buttons. My rationale is in the paragraphs below the divider.


Right! So, for clarity, I'm not aware of any WCAG 2.2 standards about spacing between buttons or another recommendation for spacing that isn't on someone's personal blog post somewhere on the internet. But what I am referencing is WCAG 2.5.8 Target Size as the nearest tested and trustworthy information.

2.5.8 Target size mentions

  • "The size of the target is at least 24 by 24 CSS pixels" meaning the button areas themselves. We already have this. Hooray!
PyData Sphinx navbar icon buttons showing their target size of 24px by 34.4px.
  • And has the exception "Undersized targets (those less than 24 by 24 CSS pixels) are positioned so that if a 24 CSS pixel diameter circle is centered on the bounding box of each, the circles do not intersect another target or the circle for another undersized target." Now, we don't need this for the exception because we meet the minimum target size, but I think this makes clearer criteria we can use to make sure we have spacing that supports lower motor skill precision. First, the bounding boxes already don't overlap or even touch exactly. Yay! And, because they already meet the minimum target size, they pass the 24 by 24 CSS pixel diameter circle test too.

Still, I do think the idea of the circle target that does not intersect or touch the adjacent targets may be a good way to have a relative way to estimate space between buttons. By rounding out the corners of the target into a circle (not matching the diameter to the largest side), I can find that the circles do overlap just a little.

To have them not touch, we would need to add 2.5 CSS pixels, or change the`column-gap value to about 1.1–1.12 rems. Just a little nudge!

@gabalafou
Copy link
Contributor Author

@isabela-pf, I love your analysis! I think it would make a great mini blog post. I'm thinking something along the lines of how to use the spirit of accessibility guidelines, not just the letter, to guide design decisions.

I'm curious how you produced the images in your analysis. For my part, I used dev tools to add the following CSS in order to visualize the circle targets that you mentioned to make sure they don't overlap:

html .pst-navbar-icon {
  border: darkblue thin dashed;
}

html .pst-navbar-icon:before {
    background: pink;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    content: "";
    position: absolute;
    left: -10px;
    top: -8px;
    opacity: 50%;
}
visualization of circle targets shows that with code changes, the circle targets no longer overlap

@gabalafou
Copy link
Contributor Author

I'm curious how you produced the images in your analysis.

Discussed in today's team call, the process was to start with screenshot from Firefox with dev tools open and inspecting one of the nav icons, and then importing into Figma and annotating.

Carreau pushed a commit to pydata/pydata-sphinx-theme that referenced this issue Aug 28, 2024
Fixes external issue:
Quansight-Labs/czi-scientific-python-mgmt#81

This PR increases the horizontal gap between the navbar icons slightly
(1rem to 1.12rem) to align better with accessibility guidelines. The
idea is to make sure that the circle targets (pink) do not overlap.

<See Image in pr 1964>

It would be nice if we could rework the navbar icon links to have a
known hit area at build time (hit area being the union of width, height,
and padding). That way we could calculate the [needed horizontal and
vertical
margins](Quansight-Labs/czi-scientific-python-mgmt#81 (comment))
with SCSS, like so:

```scss
@mixin enclosing-circle-margin($hit-area-width, $hit-area-height) {
  // the diagonal of the hit area rectangle is also the diameter of the minimum enclosing circle
  $hit-area-diagonal: math.hypot($hit-area-width, $hit-area-height);
  $mx: ($hit-area-diagonal - $hit-area-width) / 2;
  $my: ($hit-area-diagonal - $hit-area-height) / 2;

  margin: $my $mx;
}
```

But that will have to be for another time.
@gabalafou gabalafou self-assigned this Sep 12, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to 💪🏾 Done in czi-scientific-python 🐍 Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants