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

Review <Icon> usage #11195

Open
mcoker opened this issue Nov 14, 2024 · 1 comment
Open

Review <Icon> usage #11195

mcoker opened this issue Nov 14, 2024 · 1 comment

Comments

@mcoker
Copy link
Contributor

mcoker commented Nov 14, 2024

A follow up from #11005

In the backstop run for the above PR, I spotted an issue we should look into.

Screenshot 2024-11-14 at 1 24 52 PM

That's from this right-to-left table demo and this file -

<Button
variant="primary"
icon={
<Icon shouldMirrorRTL>
<AlignRightIcon />
</Icon>
}
iconPosition="end"
onClick={switchTranslation}
>
{translation.switchBtn}
</Button>

We use <Icon shouldMirrorRTL /> as the preferred way of including an icon that should mirror/flip if the document is set to dir="rtl", so I'm thinking we need to keep that there, and add isInline to let the <Icon> inherit the color and font-size from its parent instead of using our default icon color/size.

And just looking at that demo, looks like we have that same issue in the labels, too. For example, this one

<Label
color="green"
icon={
<Icon shouldMirrorRTL>
<WalkingIcon />
</Icon>
}
>
{translation.table.rows.status.running}
</Label>

I updated the first label in the table and added .pf-m-inline to the .pf-v6-c-icon in dev tools and you can see it resized the icon since icons in labels are smaller than our default icon size

Screenshot 2024-11-14 at 1 39 48 PM

I'm not sure how big of a lift it would be, but I would probably suggest we just review each use of <Icon> in the examples/demos and if it's used in a component that wants to style the icon color/size, we consider 1) removing <Icon> if it isn't necessary, and 2) adding isInline if it is necessary.

@github-project-automation github-project-automation bot moved this to Needs triage in PatternFly Issues Nov 14, 2024
@mcoker mcoker changed the title Review <Icon> color usage Review <Icon> usage Nov 14, 2024
@tlabaj tlabaj moved this from Needs triage to Backlog in PatternFly Issues Dec 5, 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.

@github-actions github-actions bot added the Stale label Jan 14, 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

1 participant