menu

styled-components

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

Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# Help
view-forward
# jest
view-forward
# Off Topic
view-forward
# Website
view-forward
Team
Posts
Members
Info

Is it possible to style an imported generic functional component?

I'm importing a generic functional component, and hoping to override the padding styles on it. I'm trying to do something like this: I'm having trouble finding an example of this done anywhere. I know I could just wrap SomeGenericComponent in a wrapper to style it how I want,…

thumbsup
0
message-simple
9

Am I passing a theme prop into another component correctly?

For example, I have a component that looks like this: Container Component …

thumbsup
0
message-simple
2

How to reference styled-components within an object

I've been creating styled components within a single object to help differentiate between styled vs. React components alongside getting suggestions. It's been working great except when needing to reference other styled-components. Has anyone else been doing it this way and found…

thumbsup
0
message-simple
4

What is the best way to merge multiple styled-components?

this solution doesn't seem to work very well also, it's using an API that is due to be deprecated …

thumbsup
1
message-simple
2

Best practice when styling Components that are made of multiple elements

How do you style for example this: <header> <svg/> …

thumbsup
0
message-simple
9

Filtered props from HTML with "as" polymorphic prop

Because there is no good way to filter out attributes from the final HTML element, I've been using an HOC to handle it. It's important for us because AMP pages fail validation if it doesn't recognize HTML attributes. Used like so: Unfortunately if I use the polymorphic prop as…

thumbsup
0
message-simple
2

styles missing in cra production build but not in dev

Hi Thanks for any help in advance. Really appreciate it. I have created a website using chartjs and styled components really for the first time using either and it works fine in development. But when I build the production build using 'npm run build' most of the css is now…

thumbsup
0
message-simple
9

Methods and Template String

Hey guys! I was creating a component and I was really missing MIXINS from SASS, so I decided to create something like that: And than, call the method like that: …

thumbsup
0
message-simple
4

Using styled-components in static non-react pages

We are working on a component library built with styled-components in React; however, we have static pages (simple html and css) as well as dynamic React pages in our application. I am looking for a way to use styled-component styles/elements in our static pages in order to…

thumbsup
0
message-simple
4