Skip to content

[Button] Make primary the default color#21594

Merged
oliviertassinari merged 10 commits intomui:nextfrom
mbrookes:button-color-deprecate-default
Jun 30, 2020
Merged

[Button] Make primary the default color#21594
oliviertassinari merged 10 commits intomui:nextfrom
mbrookes:button-color-deprecate-default

Conversation

@mbrookes
Copy link
Member

@mbrookes mbrookes commented Jun 27, 2020

Breaking change

  • The button color prop is now "primary" by default, and "default" has been removed. This makes the button closer to the Material Design specification and simplifies the API.
-<Button color="default" />
-<Button color="primary" />
+<Button />
+<Button />

Closes #17530

@mbrookes mbrookes added breaking change Introduces changes that are not backward compatible. scope: button Changes related to the button. labels Jun 27, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Jun 27, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 02e7759

@oliviertassinari

This comment has been minimized.

@oliviertassinari

This comment has been minimized.

@mbrookes mbrookes changed the title [Button] deprecate default color for primary [Button] remove default color Jun 27, 2020
@mbrookes mbrookes changed the title [Button] remove default color [Button] Make primary the default color Jun 27, 2020
@mbrookes

This comment has been minimized.

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Looks great.

  • I could only find this case to fix:

Capture d’écran 2020-06-28 à 17 30 27

  • Could you also update the migration guide?

@mbrookes
Copy link
Member Author

Could you also update the migration guide?

It was done already:

https://github.com/mui-org/material-ui/pull/21594/files?file-filters%5B%5D=.md#diff-019068d088cdf7a1aeda9214a944a589

Comment on lines +65 to +67
```
/(<Button(\n*.*?)*?)color="primary"/$1/g
```
Copy link
Member

Choose a reason for hiding this comment

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

What does it mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a regex (in Vim search and replace format) that removes color="primary" from Buttons.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, maybe we should explain? I don't know how to use it. Do we have something that can work with VScode?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's omit it.

Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@oliviertassinari oliviertassinari merged commit c9e2181 into mui:next Jun 30, 2020
@oliviertassinari
Copy link
Member

Capture d’écran 2020-06-30 à 23 35 43

We have missed this regression. @mbrookes Could you have a look? :)

@mbrookes mbrookes deleted the button-color-deprecate-default branch July 1, 2020 00:05
@eps1lon eps1lon added this to the v5 milestone Jul 20, 2020
@eps1lon eps1lon mentioned this pull request Aug 5, 2020
42 tasks
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: button Changes related to the button.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Button] Remove default color, use primary by default

4 participants