Skip to content

[IconButton] Add size large and update styles#26748

Merged
siriwatknp merged 14 commits into
mui:nextfrom
siriwatknp:fix/icon-button-sizes
Jun 17, 2021
Merged

[IconButton] Add size large and update styles#26748
siriwatknp merged 14 commits into
mui:nextfrom
siriwatknp:fix/icon-button-sizes

Conversation

@siriwatknp

@siriwatknp siriwatknp commented Jun 14, 2021

Copy link
Copy Markdown
Member

BREAKING CHANGE

  • The default size's padding is reduced to 8px which makes the default IconButton size of 40px. To get the old default size (48px), use size="large". The change was done to better match Google's products when Material Design stopped documenting the icon button pattern.

    -<IconButton>
    +<IconButton size="large">

close #24045

🔗 https://deploy-preview-26748--material-ui.netlify.app/

  • add size large
  • update padding on small and medium size
  • update ButtonSizes demo to include <IconButton size="large">
  • add to migration-v4.md about breaking change

One thing I notice, should label be removed from IconButton same as #26666

inherit small[20px] medium[24px] (default) large[35px]
small[5px > 18px] 28px 30px 36px 47px
medium[8px] (default) - 36px 40px 51px
large[12px > 28px] 52px 44px 48px 59px

@siriwatknp siriwatknp added breaking change Introduces changes that are not backward compatible. scope: icon button Changes related to the icon button. labels Jun 14, 2021
Comment thread docs/pages/api-docs/icon-button.json
@mui-pr-bot

mui-pr-bot commented Jun 14, 2021

Copy link
Copy Markdown

Details of bundle changes (experimental)

Generated by 🚫 dangerJS against 92f3876

Comment thread docs/src/pages/components/buttons/ButtonSizes.js Outdated

@mnajdova mnajdova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The argo's diffs look expected. I would just simplify the ButtonSizes example.

@oliviertassinari oliviertassinari changed the title [IconButton] add size large and update styles [IconButton] Add size large and update styles Jun 14, 2021

@oliviertassinari oliviertassinari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The change definitely yields a different UX when browsing the page. It feels different but it seems OK


This might be off. It doesn't feel vertically aligned:

Capture d’écran 2021-06-15 à 01 01 58

Comment thread docs/pages/api-docs/icon-button.json
Comment thread packages/material-ui/src/IconButton/IconButton.js Outdated
Comment thread docs/src/pages/components/buttons/ButtonSizes.js Outdated
@siriwatknp

Copy link
Copy Markdown
Member Author

The change definitely yields a different UX when browsing the page. It feels different but it seems OK

I adjust those IconButton to have size="large" to remain the same looks and feel. please review again.

@siriwatknp

siriwatknp commented Jun 15, 2021

Copy link
Copy Markdown
Member Author

Overall argos looks fine to me, only TextField adornment that looks a bit weird.

@oliviertassinari

oliviertassinari commented Jun 15, 2021

Copy link
Copy Markdown
Member

Overall argos looks fine to me, only TextField adornment that looks a bit weird.

@siriwatknp Actually, I believe the icon button on the app bar should be size="large". It seems to be what Google uses on its products. How about we change it?

only TextField adornment that looks a bit weird.

It feels different, I would personally vote for saying it's OK. But these screenshots, x2 the size on GitHub's comment are disturbing 😁


You increased the size of the padding, but it doesn't feel aligned:

Capture d’écran 2021-06-15 à 12 05 17

I think that it was more visible with the size="medium" but this wasn't the root cause.

Comment thread docs/src/pages/guides/migration-v4/migration-v4.md Outdated
@siriwatknp

Copy link
Copy Markdown
Member Author

I believe the icon button on the app bar should be size="large"

updated the docs AppBar and also some demos in AppBar that make sense to use <IconButton size="large">

@siriwatknp

Copy link
Copy Markdown
Member Author

I believe the icon button on the app bar should be size="large"

updated the docs AppBar and also some demos in AppBar that make sense to use <IconButton size="large">

You increased the size of the padding, but it doesn't feel aligned:

It is aligned now.


### IconButton

- The default size's padding is reduced to `8px` which makes the default IconButton size of `40px`. To get the old default size (`48px`), use `size="large"`. The change was done to better match Google's products when Material Design stopped documenting the icon button pattern.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: the font size is a bit different for the size: 'large' too, but not sure if it is worth mentioning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can you point to me what is the different?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah, I see. I think it is fine not to mention.

@siriwatknp
siriwatknp merged commit fb960fa into mui:next Jun 17, 2021
@siriwatknp
siriwatknp deleted the fix/icon-button-sizes branch June 17, 2021 01:58
@siriwatknp siriwatknp mentioned this pull request Jun 23, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. scope: icon button Changes related to the icon button.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IconButton] Improve size values

4 participants