menu
announcement

Spectrum will become read-only on August 10, 2021. Learn more about the decision in our official announcement.

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 there an equivalent to styledComponentId that returns the dynamic class?

I'd like to get a reference to this in my react component so I can target each instance of the same styled component.

thumbsup
0
message-simple
0

How to automatically add className to all the styled-components?

Hi! I'm looking for a way to automatically add className to all the styled components (e.q. const MyButton = styled.button `` should then have <button class="MyButton" ... ). since we're creating components which are then used also in other projects and we want to enable for…

thumbsup
0
message-simple
0

[TypeScript] How to extract the prop types of a CSS util/mixin?

Looking for a way to get the prop types not of a component but a CSS util, e.g.: And then the component that uses it (PropType is the thing I'm looking for. React.Component<...> doesn't work here because Mixin is not a component, and TypeScript's native Parameters<...> doesn't…

thumbsup
0
message-simple
1

TS: Accept `as` prop in a wrapper component to send in to styled-component

I am wondering how I can reuse the as prop TypeScript type in this wrapper component:

thumbsup
0
message-simple
3

CSS Grid and prefixing?

I'm noticing that I'm not getting any vendor prefixes in IE11 for CSS Grid properties. I believe Styled Components is using autoprefixer under the hood and I think there are some configuration options that can be used with regard to Grid properties and how autoprefixer processes…

thumbsup
1
message-simple
8

Design System with microrepo architecture

Hi! I'm working on the product that will need to provide few (3-4) CRA projects. There is also a must have priority on themes, because I'll need to cover 100+ themes for different clients for all the apps. I've started to implement the solution with few react libraries: 1.…

thumbsup
0
message-simple
1

V3 to V4 migration issue with modals

Hello! PROBLEM: "theme" from ThemeProvider is not propagated to Modal Children. VERSION: migration from 3.4.2 to 4.4.1 …

thumbsup
0
message-simple
0
Deleted·54d# Help

Help when using styled-components with ant design

There is probably a way to do this, but this is my first time using styled components and ant design... I want to find out how to target elements that only appear in the DOM tree when triggered, such as the input select options from ant design? They are a completely separate…

thumbsup
0
message-simple
3

Does a theme need to be bundled when using NextJS?

I'm trying to optimize a nextJS application and I noticed that in our bundle our entire theme is appearing, even though we're pre-rendering the pages. I'm wondering if there's a way to make our bundle smaller by eliminating the theme itself, since we don't really need it after…

thumbsup
0
message-simple
0
Deleted·93d# Help

Does anyone know of a way to make the css prop feature work without Babel?

I've been playing with ESBuild and it is SO MUCH FASTER and our projects all seem to be building fine -including the standard "styled" api of SC ...but since there is no Babel plugin, anytime we've used the CSS prop approach these just get left as CSS attributes in the HTML…

thumbsup
0
message-simple
0