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

feat: Updated route-pill with a new size, currently called "large-format" #2600

Merged
merged 5 commits into from
May 20, 2024

Conversation

hannahpurcell
Copy link
Collaborator

@hannahpurcell hannahpurcell commented May 16, 2024

Asana Ticket: https://app.asana.com/0/1205385723132845/1207260183650054

Test new format by adding className c-route-pill--large-format to any RoutePill. Otherwise, RoutePill defaults to smaller format.

@hannahpurcell hannahpurcell requested a review from a team as a code owner May 16, 2024 14:42
Comment on lines +13 to +15
display: flex;
flex-direction: column;
justify-content: center;
Copy link
Member

Choose a reason for hiding this comment

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

question(non-blocking): why the switch to flex?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After expanding the route pill width/height, I needed a way to get the text centered, and flex is what always comes to mind for positioning for me. But I also realize, I could instead expand line-height for the text to be the height of the route-pill, so line-height:2.25rem. (I didn't think of that since the Figma specified line-height 1.5rem, but it's a value that doesn't have impact.) Is this preferable?

.c-route-pill {
  width: 2.875rem;
  height: 1.5rem;

  border-radius: 0.8125rem;

  text-align: center;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 700;
  font-family: $font-family-route-pill;

  &--large-format {
    width: 4.5rem;
    height: 2.25rem;
    line-height: 2.25rem;
    border-radius: 1.875rem;
    font-size: $h3-font-size;
    font-weight: 600;
  }
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Would line-height: 1.5 work? That way it would auto-adjust based on the font size

https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#number

Copy link
Collaborator Author

@hannahpurcell hannahpurcell May 16, 2024

Choose a reason for hiding this comment

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

The height to font-size ratio is not consistent for both versions of this button. So font-size:height for the default version is 1:1.5 while font-size:height for the large format is 1.25:2.25 or 1:1.8

EDIT: so line-height cannot be simplified to one ratio or the other

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahhh - I had thought it was 1.5 : 2.25 and 1 : 1.5, which would have been consistent.

I'll back out of this conversation then, since I don't have an opinion on this (I would probably have gravitated towards flex too, fwiw)

Copy link

Coverage of commit d590547

Summary coverage rate:
  lines......: 93.6% (3241 of 3463 lines)
  functions..: 73.4% (1340 of 1825 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

@hannahpurcell
Copy link
Collaborator Author

hannahpurcell commented May 16, 2024

I need to make a story for this! EDIT: ✅ done

Copy link

Coverage of commit e0043b3

Summary coverage rate:
  lines......: 93.6% (3241 of 3463 lines)
  functions..: 73.4% (1340 of 1825 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

Copy link

Coverage of commit 6495a57

Summary coverage rate:
  lines......: 93.6% (3241 of 3463 lines)
  functions..: 73.4% (1340 of 1825 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

@@ -1,6 +1,5 @@
.c-route-pill {
min-width: 2.875rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh 🤔

Copy link
Contributor

@joshlarson joshlarson left a comment

Choose a reason for hiding this comment

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

I made one comment that I'm interested in your thoughts on, and I think this is 👍 either way

Copy link

Coverage of commit 08c065c

Summary coverage rate:
  lines......: 93.5% (3241 of 3465 lines)
  functions..: 73.3% (1340 of 1828 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

Copy link
Contributor

@joshlarson joshlarson left a comment

Choose a reason for hiding this comment

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

🗺️ 💊

@hannahpurcell hannahpurcell merged commit a46dd31 into main May 20, 2024
15 checks passed
@hannahpurcell hannahpurcell deleted the hp/new-route-pill-size branch May 20, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants