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

Performance during hydration

I have a gatsby site that uses Styled Components. During page load, hydration takes a long time. I can see many, many calls to generateAndInjectStyles in the flame chart in dev tools. Is this expected? The styles are already present in the page (from SSR). I would expect that…

thumbsup
1
message-simple
1

How to style SVGs in React Native?

Hi all - thanks for the great lib. I'm trying to style SVG icons in React Native with styled-components and react-native-svg. I import the svg with react-native-svg, then try to style it using const Component = styled(SVGComponent). However, the css I'm adding to the styled…

thumbsup
1
message-simple
3

Is there a way to pass padding or margin dynamically through props?

I understand I can just do something like: and apply that to a margin right ternary but how can I go about applying shorthands like ma={'25', '25', '25', 25',} …

thumbsup
0
message-simple
4

is there any open source apps thats written in typescript, styled-components?

In my project, i am using typescript, react, styled-components. But I am new to styled-components, i would like to know if there any open source projects, blogs are available for reference.

thumbsup
0
message-simple
0

Has anyone got HMR working with Vitejs?

I get a full page reload every time I edit a styled component vs HMR as would be expected when using it in combination with Vitejs.

thumbsup
0
message-simple
0

Feat req: Add prop to allow for encapsulating selectors to component

Problem I hate looking at a component and seeing stuff like this: There are a few things that bother me about this. …

thumbsup
0
message-simple
1

How can I focus trap with styled-components?

I'm currently using styled-components 5.0.1. My goal is to set a focus trap within a modal with the method of accessing a DOM node through querySelector. I was able to achieve this before by grabbing a classname, but now with styled-components my problem is that randomized…

thumbsup
0
message-simple
2

UI breaking on server using styled components

Hello everyone. I need some guidance and help on the usage of styled-components. I did 3 projects in my office with the team and all are breaking sometimes and generate weird css sometimes. All projects are working fine on localhost. What is the solution for this we have to…

thumbsup
0
message-simple
14

Best Styled-Components Grid System

I need to reassess the grid in our new app. Right now I'm using Reflexbox from Rebass which works well, I especially like the styled-system integration where width={[1, 1/2, 1/3]}. But requirements changed and I'm basically having to re-build the final views from scratch. I took…

thumbsup
0
message-simple
7

How to send styles as a prop to a styled component

with styled-components I'm wondering if I can send a styled object as a prop to another styled object

thumbsup
0
message-simple
1