menu

styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress!

Channels
Team
Posts
Members
Info

vscode css prop syntax highlight and colorize

Do any one of you know a way to properly highlight syntax within the css prop in VSCode? Bonus points if you know how to make colorize work there too!

thumbsup
0
message-simple
0

Problems with SSR (weird injection locations)

Hi! Been toying around with SSR in a custom NodeJS-server and got some empty styles-tag generated in head while another with the correct contents are injected into body. Here's some code to stare at: The serverside situation: …

thumbsup
0
message-simple
1

Accessing target component's props

Is it possible to access target props when referring to another component? Something like this (pseudo):

thumbsup
1
message-simple
0

Basic styling

Hello, I'd like to set some basic styles for an component which is passed as a prob. Not sure how to set some base styles for thats passed component. This is where I'am struggling with: How I apply the baseStyles to <Component/> ? Something like this. But the docs say don't use…

thumbsup
0
message-simple
1
Deleted·10d# Help

@import of Google Font not working in v5

I have an import of a google font in my createGlobalStyle that was previously working with v4 of styled-components. Now it doesn't seem to be getting loaded in at all. Has anyone else had this issue? Will create a github issue if this is a new. Thanks!

thumbsup
0
message-simple
5

css prop not working with Rollup

I dont seem to be able to get the css property to work when building my library with Rollup. Is there a specific way I need to be handling this with the babel plugin? When I build the above into a lib, then import it into another application, the css prop doesn't seem to take…

thumbsup
1
message-simple
1

Css prop rollup transform

I cant seem to get the css prop to work with rollup and the Babel plugin. Any help would be great. Is it better practice to convert the css prop styles to a styled component?

thumbsup
1
message-simple
1

createGlobalStyle() and shouldComponentUpdate()...?

hey there 👋 having recent migrated to styled-components v4, i'm noticing that now that i'm using createGlobalStyle() to render my global styles, they are being re-rendered on each change. this causes my entire page to reflow as fonts are re-fetched and applied (amongst other…

thumbsup
1
message-simple
0

TypeScript: Extend React component props for styled component element

i'm trying to extend a react components props in TypeScript so that it contains all the normal html button attributes, as well as react specific stuff like ref My understanding is that the type React.HTMLProps is what i need, (React.HTMLAttributes doesn't contain ref) However,…

thumbsup
0
message-simple
3

Possible to generate a StyledComponent with a className without a comoponent?

I am using ReactHoverObserver which generates its own div that needs restyling - it does give me the ability to provide a className I'd like to use styled-components here though. Is there a way I can generate a styled component and just get back the className to use as I wish?

thumbsup
0
message-simple
1