Comments (7)
What do you mean by
mergeSx()
?
Basically the logic of https://mui.com/system/getting-started/the-sx-prop/#passing-the-sx-prop.
It is not super complicated by itself, but it is complex enough to not to repeat this on multiple components.
That's why a util function like this exists: https://github.com/RobinTail/merge-sx
from material-ui.
As long as there's a codemod that can be used to convert all of our existing like props, I think this is a good move.
from material-ui.
Previously, I have suggested the exact opposite, which is to allow other components to make use of sx-like props #37677. But then some one pointed out this can be hard to do on components that already have props of the same name. So I believe this RFC is the 2nd best option for consistency.
However, if we are going towards this route, I think MUI should provide a mergeSx()
util out of the box, since the usage of it will just increase when this change happened.
from material-ui.
What do you mean by mergeSx()
?
from material-ui.
Removing those makes sense to me. I personally never use them, and they will be hard to support for Pigment CSS. Having one prop dedicated to styles makes sense, e.g. className
prop for utility classes systems. It also reduces the decision fatigue for developers.
On the execution, it seems that it should be deprecated in Material UI v6, without support for Pigment CSS and then removed in Material v7. It feels too much of a pain/brutal to remove them without a deprecation phase and even with codemods.
from material-ui.
On the execution, it seems that it should be deprecated in Material UI v6, without support for Pigment CSS and then removed in Material v7. It feels too much of a pain/brutal to remove them without a deprecation phase and even with codemods.
I think it's better to do breaking change than deprecations given that the sx-like props are in some components. It would reduce a lot of complexity on our side.
from material-ui.
@siriwatknp We are paying for the complexity today, and we won't do the effort to make it work Pigment CSS. As much as it would be great to just remove stuff in one major, I don't think that it's how we should operate, as a user, it would make it feel that we are disconnected from real-life projects and reinforce that when you use something by MUI, you subscribe to costly migrations. Instead, I think that spaning changes in two majors and make more frequent majors would be great.
Basically the logic of https://mui.com/system/getting-started/the-sx-prop/#passing-the-sx-prop.
It is not super complicated by itself, but it is complex enough to not to repeat this on multiple components.
That's why a util function like this exists: https://github.com/RobinTail/merge-sx
@mwskwong I have found the issue in question: #37677. I'm moving the conversation there 👍
from material-ui.
Related Issues (20)
- [pigment-css][react] throws errors in non-browser environment (i.e. unsafe when referenced) HOT 13
- [joy-ui][Input] Input element `onChange` nested in MenuItem does not fire. HOT 1
- [joy-ui] How to adjust theme spacing with HTML font-size: 10px HOT 2
- [joy-ui][Checkbox] Not using the correct font in the Next.js example HOT 6
- [material-ui][Slider] Sometimes the value in onChange and the value in onChangeCommitted are output differently HOT 9
- [material-ui][Tooltip] enterDelay prop resets timer on every child mouseOver event
- [joy-ui][FormControl] Label is being displayed above the input HOT 2
- [icons] Add a drone icon HOT 4
- Same code in both JS and TS variants for multiple components on mui docs HOT 1
- [material-ui][Slider][CssVarsProvider] Custom `SliderThumb` with `CssVarsProvider` is broken after upgrade `@mui/material` to `5.15.14` HOT 1
- [docs-infra] Multi-tab demo component improvements
- [material-ui][Autocomplete] Formik Form with multiple fields triggering all fields to be opened HOT 3
- [joy-ui][Theme] Components use radius 'sm' irrespective of their own size.
- [JOY with material-ui]
- [material-ui][Typography] Trouble adding new boolean props HOT 2
- Unable to target `MuiTooltip-tooltip` class
- [material-ui][Slider] TypeError: color.charAt is not a function error message after upgrade @mui/material to 5.15.14 HOT 5
- [pigment-css] Invalid CSS output w/ pseudo classes in theme.vars HOT 4
- [TextField] Add an isValid state to correspond to the error state. HOT 2
- [pigment-css] theme does not contain other properties except `vars` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-ui.