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

fix(button): update icon size to the default size #29255

Merged
merged 7 commits into from
Apr 10, 2024
Merged

fix(button): update icon size to the default size #29255

merged 7 commits into from
Apr 10, 2024

Conversation

joselrio
Copy link

@joselrio joselrio commented Apr 2, 2024

Issue number: ROU-4815


What is the current behavior?

  • Ionic theme, Icon size was 14px to the default button size;

What is the new behavior?

  • Ionic theme, Icon size has now 16px to the default button size;

NOTE:

  • Tests related... this a fix on top of PR of ROU-4815 branch and as was mentioned there, tests will be implemented under a task that will be then created specifically for it.

@joselrio joselrio requested a review from a team as a code owner April 2, 2024 17:13
@joselrio joselrio requested review from thetaPC and removed request for a team April 2, 2024 17:13
@github-actions github-actions bot added the package: core @ionic/core package label Apr 2, 2024
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

Also the PR title needs to be updated to follow the conventional commits structure. Example: fix(button): update icon size to the default size

Notice that the example:

  1. doesn't wrap the type with brackets
  2. doesn't have capital words
  3. uses present tense
  4. doesn't use the word fix in the description since it's already mentioned through the type

You can also find more details under the Ionic Framework PR Process guide.

Comment on lines 39 to 43
::slotted(ion-icon[slot="start"]),
::slotted(ion-icon[slot="end"]),
::slotted(ion-icon[slot="icon-only"]) {
font-size: px-to-rem(16);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that there are two instances of this. What's the difference between this one and the grouping further in the file?

Copy link
Author

Choose a reason for hiding this comment

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

You're right @thetaPC 🤦. Thank you!
Already fixed!

@joselrio joselrio changed the title [fix](button): Fix icon size to the default size. fix(button): Update icon size to the default size. Apr 3, 2024
@joselrio joselrio changed the title fix(button): Update icon size to the default size. fix(button): update icon size to the default size. Apr 3, 2024
@thetaPC
Copy link
Contributor

thetaPC commented Apr 3, 2024

@joselrio one last thing on the PR title that needs to change, remove the period. The PR titles shouldn't have punctuation marks. Thank you!

Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

We also need a test within core/src/components/button/test/icon/button.e2e.ts to verify that there will be no visual regressions moving forward. I recommend updating the current one to include these modes, modes: ['ios', 'md', 'ionic-md'], within the configs function.

configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('button: icon'), () => {
    test('should not have visual regressions', async ({ page }) => {
      await page.goto(`/src/components/button/test/icon`, config);

      await page.setIonViewport();

      await expect(page).toHaveScreenshot(screenshot(`button-icon`));
    });
  });
});

@joselrio joselrio changed the title fix(button): update icon size to the default size. fix(button): update icon size to the default size Apr 4, 2024
@joselrio
Copy link
Author

joselrio commented Apr 4, 2024

@thetaPC as was mentioned at the base PR for the button, tests will be done under a new task that will be created specific for it.

@joselrio joselrio requested a review from thetaPC April 4, 2024 08:36
@thetaPC
Copy link
Contributor

thetaPC commented Apr 4, 2024

@joselrio Understood on the test. Please update the PR description to mention that tests will be done through another PR.

@joselrio joselrio requested a review from thetaPC April 5, 2024 08:48
@joselrio
Copy link
Author

joselrio commented Apr 5, 2024

@thetaPC I think you did not understood the difference between em and rem units. Icons has already sizes you mentioned due to font-size applied at the context and the usage of em units for the icons font-size.

Note that (example), If button font-size: 14px, and icon:

  • font-size: 1em, then icon will have 14px as well;
  • font-size: 0.5em, then icon will have 7px;
  • font-size: 1.5em, then icon will have 21px;

For the default (medium) size there is the need to be different since font-size is 14px (converted into rem(s)) and the icon should have 16px (on this particular case, also converted into rem(s)).

Take a look at the images below please:

xsmall
xsmall

small
small

default/medium
default:medium

large
large

xlarge
xlarge

Let me know if you have any doubt about it.

@thetaPC
Copy link
Contributor

thetaPC commented Apr 8, 2024

Discussed offline:

The icon sizes don't behave as expected when the font increases through the app. This is what it looks like when a user increases the font size, the left side is default and the left side is large. Notice how the large icon is smaller than default.

image

This PR is on hold until the design team can determine next steps.

@thetaPC
Copy link
Contributor

thetaPC commented Apr 9, 2024

Closing this PR due to my previous comment regarding having to wait for the design team. This will be re-visited at a later date.

@thetaPC thetaPC closed this Apr 9, 2024
@thetaPC
Copy link
Contributor

thetaPC commented Apr 9, 2024

Disregard my previous comment, we want to leave this PR open and then make a new with design's decision.

@thetaPC thetaPC reopened this Apr 9, 2024
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

LGTM, this is accomplishing its intended result. The cause for delay was a lack of understanding on how dynamic font manual testing should have happened.

Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

We discussed as a larger team and I included some information in our Slack as well.

These changes look good when tested with dynamic font scaling. The maximum scale for dynamic font scaling is 310%.

@joselrio joselrio merged commit 0decc77 into next Apr 10, 2024
67 of 84 checks passed
@joselrio joselrio deleted the fix/ROU-4815 branch April 10, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants