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

[Investigation] Difference in line-height between DS and DSR #303

Open
1 task done
meissadia opened this issue Feb 1, 2024 · 2 comments · May be fixed by #312
Open
1 task done

[Investigation] Difference in line-height between DS and DSR #303

meissadia opened this issue Feb 1, 2024 · 2 comments · May be fixed by #312
Assignees

Comments

@meissadia
Copy link
Contributor

meissadia commented Feb 1, 2024

We're seeing issues in DSR with icon misalignment due to variation in the way line-height: normal is calculated when compared to the same element in DS.

Example: Multiselect's selected option buttons

Both DS and DSR have line-height: normal

  • in DS this equates to 19px
  • in DSR this equates to 22px

In the second row of screenshots below you may be able to see that in DSR there is additional space around the #text content due to the extra height, along with the x icon being shifted higher

Screenshots

DS DSR
Image Image
Image Image

Fix in DSR

I'd be weary of making a large scale change to the line-heights in DSR, but if we can determine which other elements are affected (probably anywhere that has text + icon) then we can correct them by setting a specific value for those elements' line-height (as opposed to "normal")

.o-multiselect_choices button {
  // (target height) / (font-size) => (19/16) => 1.1875 
  line-height: 1.1875; 
}

I would love help understanding why this difference is occurring and if the proposed approach makes sense.

TODO

  • Audit components to see where else this is happening
@meissadia
Copy link
Contributor Author

Elements with icons

Seem misaligned

Seem okay

@meissadia
Copy link
Contributor Author

I think the issue may be with the DSR's .cf-icon-svg-wrapper class.

In the video below we can see that when highlighting just the SVG element, the spacing on the top/bottom seem even.

However, when highlighting the wrapper element we can see a bit of extra bottom spacing.

I will need to dig further.

Screen.Recording.2024-02-15.at.4.57.27.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant