Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[docs] Revise "Component theming" and "How to customize" guides #31997
[docs] Revise "Component theming" and "How to customize" guides #31997
Changes from 5 commits
25b712c
100e7a3
974ea77
b5307a1
f29a278
5f2bb54
273cd2a
e3b4ce1
832c3ec
15e12f0
24b4bb2
c72125e
260faa1
9fd751e
6ffc1c3
b44e391
bda05ff
5c0bc5d
08070da
1429338
9cf2a44
af44cf2
36436d4
ef3c447
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change of docs/public/static/images/customization/dev-tools.png looks blurry on my screen. Am I the only one? I mean:
a. https://mui.com/customization/how-to-customize/#overriding-nested-component-styles
b. https://deploy-preview-31997--material-ui.netlify.app/customization/how-to-customize/#the-sx-prop
a. looks better on my end. I'm raising this because it's not the first time I see this problem. What do you think of limiting the resolution to x2, would it solve the problem? Otherwise, could we try a fixed integer increment? Currently, we are doing x3.28, maybe x3 or x4 would look crisp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh... looks a bit blurry to me too, now that I'm looking at it again. But I did export at 2x (don't know where you got x3.28 from!). Though the blurriness could be because I increased the image size a bit. Let me see if I can tweak it properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I fully understand the answer to this question. Here's what I gather:
Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly more than CSS pseudo-classes? they have the same as pseudo states, see https://codepen.io/mnajdova/pen/mdpwxyYcomponentscomponent's state using these classesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should move this back right before the demo showing how it should be altered in TypeScript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before or after? Haven't altered its position, its in the same spot as in the current version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we elaborate on why a developer would want to do this? And this would also be a good place to explain why this is "experimental."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mnajdova anything you'd like to share about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly for conistency. If a developer is already used to the
sx
syntax and it's shorthands, it's limiting that it can be used on only one place (thesx
prop). More over, if they want to convert fromsx
prop tostyled()
, or move the styles to the theme overrides, they would have to manually change the styles to comply with the other regular syntax. This utility helps them by doing it automatically and providing a better DX along the way.It's experimental as it was added after the v5 stable release, and we usually export API like this as an experimental first, to see if there will be some unforeseen bugs and stabilize them later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think, tackled these aspects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danilo-leal I was wrong. The
Link
is actually a bug. This should have the highest priority<Link color="highest-priority-color">...</Link>
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this part and I will create a fix in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! I was just thinking it was weird for the component color prop to have lower specificity... I'll correct this sentence!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@siriwatknp are you going to bump the specificity for each prop combination? Should we create an RFC for this and make it work consistent with Material UI? In this case, when would you ever need the props callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mnajdova I am not sure I follow you. From my understanding, this is a bug on the Link component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that the Typography (and Link) are basically the ones that work differently, in the other components that theme overrides take precedence, for example take a look at the button - https://codesandbox.io/s/shy-dust-sdylec?file=/src/App.tsx