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 · 1 comment
Open
Labels

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))
@phill-85 phill-85 added the bug label Aug 22, 2024
@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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Parking lot
Development

No branches or pull requests

2 participants