why sx but css
See original GitHub issuehi, friend , this project is very good
but i have a question
in new styles , why sx but css
why this?
<Box
sx={{
... ...
}}
>
why not this?
<Box
css={{
... ...
}}
>
if we use css
, Mental burden will is very small, very easy to learnning and use
like className
、htmlFor
, in react, it’s not good design
why not htmlClass
+ htmlFor
or className
+ htmlName
thank you very much
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top Results From Across the Web
why sx but css · Issue #26627 · mui/material-ui - GitHub
The is no standard css prop on components. There is style instead. style -> stylex -> sx for short.
Read more >What is the purpose of sx prop in Material UI? - Stack Overflow
The sx prop is a shortcut for defining custom style that has access to the theme. It can accept any CSS properties plus...
Read more >The Ultimate Guide to the MUI 'sx' Prop - Smart Devpreneur
The sx prop is a superset of CSS that include built-in shorthands (i.e. mt={2} sets ... makeStyles is still supported, but it is...
Read more >transform - CSS: Cascading Style Sheets - MDN Web Docs
The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual ......
Read more >The css Prop - Emotion
The primary way to style elements with emotion is the css prop. It provides a concise and flexible API to style your components....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The is no standard
css
prop on components. There isstyle
instead.style
->stylex
->sx
for short.Once we ship v5 to a larger audience (currently at 1.7% of v4), it will be interesting to see how the community reacts to the
sx
prop that extends the behavior of thecss
prop that styled-components and emotion have made popular. For instance, one could argue that we should also expose acss
prop, simply for the sake of not changing habits.For now, it feels that @stfenjobs didn’t provide arguments to really have a discussion. Personally, since
sx
extendscss
, it seems better to not fragment the audience between two ways for doing almost the same thing.