question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hi, 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 classNamehtmlFor, in react, it’s not good design

why not htmlClass + htmlFor

or className + htmlName

thank you very much

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
michaldudakcommented, Jun 10, 2021

The is no standard css prop on components. There is style instead. style -> stylex -> sx for short.

0reactions
oliviertassinaricommented, Jun 10, 2021

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 the css prop that styled-components and emotion have made popular. For instance, one could argue that we should also expose a css 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 extends css, it seems better to not fragment the audience between two ways for doing almost the same thing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found