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

Bug - [Component] - Spacing discrepancy between react and html examples #10873

Open
phill-85 opened this issue Aug 22, 2024 · 4 comments
Open

Comments

@phill-85
Copy link

Describe the problem
Spacing changes between the reach and html icon examples at https://www.patternfly.org/components/icon/html

How do you reproduce the problem?
Provide steps to reproduce. A codesandbox demonstrating the problem is appreciated.

Expected behavior
Spacing should remain the same.

Screenshots
If applicable, add screenshots to help explain the issue.

What is your environment?

  • OS: Ubuntu 24.04
  • Browser:
    Firefox snap for ubuntu v129.0.2
    Brave Version 1.68.141 (Chromium: 127.0.6533.120 (Official Build) (64-bit))
@mcoker
Copy link
Contributor

mcoker commented Aug 22, 2024

@phill-85 thanks for the issue! Looks like it's due to a couple of things:

  • React creates icons via @patternfly/react-icons, which create inline <svg>s that are a square aspect ratio, and the html examples use icon fonts (FontAwesome mostly) that vary in width based on the icon size. There isn't much we can do about that, it's present in a bunch of our examples.
  • The react icon examples strip the whitespace in the rendered HTML between icon code blocks, and the HTML examples do not, so there is a space character between the HTML icons that isn't present in the react icons. We can update that - I'm thinking it's probably easier to update the react example blocks to preserve the whitespace. @tlabaj wdyt? We could add {' '} between </Icon><Icon> so it's </Icon>{' '}<Icon> (or some other preferred way to do that?)
    <Icon>
    <LongArrowAltDownIcon />
    </Icon>
    <Icon>
    <AngleRightIcon />
    </Icon>

@tlabaj tlabaj moved this from Needs triage to Parking lot in PatternFly Issues Aug 27, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@kmcfaul kmcfaul removed the bug label Oct 25, 2024
@github-actions github-actions bot removed the wontfix label Oct 28, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@thatblindgeye
Copy link
Contributor

Adding the whitespace after the Icon components in the React examples would be fine since it follows a precedent we set. @phill-85 would you happen to be interested in making this update at all?

@thatblindgeye thatblindgeye moved this from Parking lot to Ready to assign in PatternFly Issues Jan 31, 2025
@thatblindgeye thatblindgeye moved this from Ready to assign to Backlog in PatternFly Issues Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants