PaulieScanlon / paulie-dev-2019-comments-repo

The repo that holds all the comments from paulie.dev
0 stars 0 forks source link

posts/2020/08/styled-components-style-objects/ #9

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Paul Scanlon | Styled Components Style Objects

Styled Components (https://Styled Components.com/) optionally supports writing CSS as JavaScript objects instead of strings. This is…

https://paulie.dev/posts/2020/08/styled-components-style-objects/

lancepollard commented 1 year ago

How about with referencing a parent class, it's not working for me.

const Details = styled(ClickableArea)({
  display: 'flex',
});
Neon2022 commented 1 year ago

Hey three! Great Post! Awesome as a matter of fact. How to use attrs with style objects?

I was trying to pass fetchpriority to img and it aint workin.

I did try with styled(ImgWithAttr) while ImgWithAttr is smtn like <img fetchpriority={props.fetchpriority} />

but that gave me just that and all style props lost, even src

pls help!