[system] Prefer styled-components's css prop over Box css
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Summary š”
A css
prop had been added in Styled-components v4: https://www.styled-components.com/docs/api#css-prop. It is a very handy way to stylize a component, and personnaly I use it a lot.
However, it doesnāt work on the Box
component because Box
has already a css
property. I think it would be preferable not to have one to make it possible to use Styled-components one.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
[system] Prefer styled-components's css prop over Box css
I prefer when styling props are grouped because I am used to separating css and html or separating css and logic props. I...
Read more >Basics - styled-components
Automatic critical CSS: styled-components keeps track of which components are rendered on a page and injects their styles and nothing else, fully automatically....
Read more >Getting Started - Styled System
Styled System is a collection of utility functions that add style props to your React components and allows you to control styles based...
Read more >Styled Components, Styled Systems and How They Work
This code created a React component named Box that receives the props color and bg . <Box color="#fff" bg="tomato"> TomatoĀ ...
Read more >A Comparison of Three Methods for Styling Components in ...
Styled-components is the premier library for using CSS-in-JS. ... Notice how we are now computing styles based on props.
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
I am not sure about what you ask me to think about precisely but I largely prefer option 2 (āwrite them under one propā) over the other one for these reasons:
I hope my answer helps, and if I answered about the good thing.
Now that we have the
sx
prop is safe to drop thecss
prop. Will work on a PR š