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

[Reboot] New component #9661

Merged
merged 2 commits into from
Dec 29, 2017
Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Dec 29, 2017

capture d ecran 2017-12-29 a 12 02 58

Closes #9641

cc @mui-org/core-contributors

@oliviertassinari oliviertassinari added the new feature New feature or request label Dec 29, 2017
@oliviertassinari oliviertassinari self-assigned this Dec 29, 2017
@kgregory
Copy link
Member

Yes!

Copy link
Member

@kgregory kgregory left a comment

Choose a reason for hiding this comment

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

Great idea

@mbrookes
Copy link
Member

Nice idea, not sure about the name though... Perhaps Reset? (Or am I being too literal?! 😕)

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Dec 29, 2017

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Dec 29, 2017

Once it's released, we can update the examples.

@mbrookes
Copy link
Member

@oliviertassinari Actually, if this were a standalone project "Reboot" is a bit more catchy - it was just that most things in MD (so by extention in MUI) are named more literally, but that's cool.


### Typography

- We enable the font antialiasing for better display of the Roboto font.
Copy link
Member

Choose a reason for hiding this comment

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

'Font antialiasing is enabled'

Copy link
Member

@pelotom pelotom left a comment

Choose a reason for hiding this comment

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

Great idea!

},
'*, *::before, *::after': {
boxSizing: 'inherit',
},
Copy link
Member

@pelotom pelotom Dec 29, 2017

Choose a reason for hiding this comment

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

I'm curious, is there a reason to prefer this approach over simply

*, *::before, *::after {
  box-sizing: border-box;
}

?

Copy link
Member Author

@oliviertassinari oliviertassinari Dec 29, 2017

Choose a reason for hiding this comment

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

@pelotom This way, people can change the inherited value anywhere and propagate it down the tree. @nathanmarks Introduced this pattern. As far as I remember, Google Map was all broken with box-sizing: border-box;. Bootstrap approach (the one you are suggesting) was making it harder than necessary to go back to box-sizing: content-box;.

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, I didn't know about that, but it makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

However, this approach is making it harder to cherry-pick a different box-sizing on a single element.

Copy link
Member Author

Choose a reason for hiding this comment

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

So it's about cherry-picking vs, omg, it doesn't play well with this third party library.

Copy link
Member Author

@oliviertassinari oliviertassinari Dec 29, 2017

Choose a reason for hiding this comment

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

I have no idea what's best. Such a hard tradeoff 🤔 .

Copy link
Member Author

Choose a reason for hiding this comment

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

I will benchmark. copying is often the best thing to do. I do it everyday.

Copy link
Member

Choose a reason for hiding this comment

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

You could always add a prop which controls which approach you want to use.

Copy link
Member Author

@oliviertassinari oliviertassinari Dec 29, 2017

Choose a reason for hiding this comment

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

@pelotom It seems it's Bootstrap vs everybody else.

I will keep it this way. In the future, we can add a property if people ask for it with a solid use case :).

Copy link
Member

@pelotom pelotom left a comment

Choose a reason for hiding this comment

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

Since I imagine a common pattern will be

<MuiThemeProvider theme={theme}>
  <Reboot />
  <MyApp />
</MuiThemeProvider>

or similar, would it make sense to provide a convenience boolean prop on MuiThemeProvider to accomplish the same, i.e.

<MuiThemeProvider theme={theme} reboot>
  <MyApp />
</MuiThemeProvider>

?

@oliviertassinari oliviertassinari merged commit 52fcbae into mui:v1-beta Dec 29, 2017
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Dec 29, 2017

to provide a convenience boolean prop on MuiThemeProvider to accomplish the same, i.e.

@pelotom Adding the reboot boolean property will make people no using the component pay the import price of the module in their bundles. Also, it will just save people one import.

@pelotom
Copy link
Member

pelotom commented Dec 29, 2017

Good points 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants