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

Improve Select Menu spacing #844

Merged
merged 7 commits into from
Aug 23, 2019
Merged

Improve Select Menu spacing #844

merged 7 commits into from
Aug 23, 2019

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Jul 22, 2019

This makes the check icons optional. Which means that if no check icons are added, the left padding is reduced and aligned with the title:

Before After
image image

Closes #843

@simurai simurai requested a review from shawnbot July 22, 2019 12:28
@vercel
Copy link

vercel bot commented Jul 22, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://primer-css-git-select-menu-spacing.primer.now.sh

@simurai
Copy link
Contributor Author

simurai commented Jul 22, 2019

One side effect of adding the icon as inline block is that there could be a "white space gap", depending how the markup is authored. Also the Primer docs remove the white space, but storybook doesn't.

Screen Shot 2019-07-22 at 10 07 30 PM

There are a few options to remove it all the time.

@shawnbot shawnbot added this to Work in Progress in 📦 Primer CSS release tracking Jul 26, 2019
@shawnbot shawnbot changed the base branch from release-12.5.0 to release-12.6.0 August 7, 2019 20:48
@shawnbot shawnbot changed the base branch from release-12.6.0 to master August 19, 2019 18:25
Add erb to example
@simurai
Copy link
Contributor Author

simurai commented Aug 22, 2019

there could be a "white space gap"

SelectMenu-items now use flexbox to align all their content. And can always be changed by adding d-block if needed.

Ok, I think this is now ready. /cc @shawnbot

@shawnbot shawnbot mentioned this pull request Aug 22, 2019
10 tasks
position: absolute;
height: 1.5em; // Mimics line-height to vertically center the icon
margin-left: -20px;
width: 16px; // fixed width to make sure following content aligns
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious: why 16px here instead of $spacer-3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking was that the fixed width has less to do with "spacing" and is more related to the maximal width of Octicons, which are 16px.

But yeah, I'll change it to $spacer-3 to avoid ✨ magic numbers.

Copy link
Contributor

@shawnbot shawnbot left a comment

Choose a reason for hiding this comment

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

I had one question about the use of 16px, but otherwise this LGTM. Thanks for tidying this up!

@shawnbot shawnbot changed the base branch from master to release-12.6.1 August 22, 2019 20:01
@simurai simurai merged commit c6eb450 into release-12.6.1 Aug 23, 2019
📦 Primer CSS release tracking automation moved this from Ready to release to 💜 Done Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants