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

Prefixing hashes

Hi there, I'm hoping to add a prefix to the generated hash classes. Would this be something that you would consider accepting as a PR? I'm thinking I could add an env variable process.env.SC_HASH_PREFIX which would get picked up when the hash is generated and saved. Our use case…

thumbsup
1
message-simple
1

Global styles injected two times

I used below code and saw in browser that style added two times saw page it got added When I tried samething with styled.div is just added once. …

thumbsup
0
message-simple
0

Importing an external css file directly in styled components

I'm using a library which requires a css file to be imported into the react component. We need to import this file into a styled component that we can wrap the component in to enable the styling, something like: What's the best way to approach this? I need to this at the…

thumbsup
1
message-simple
10

Workflow for quickly building pages

Hey! In the past, I've been mostly using atomic CSS (bootstrap style). I see huge advantages in styled-components and migrated some of my projects to it. However, one thing I've noticed is that working on landing pages and content heavy pages have been much more time-consuming.…

thumbsup
1
message-simple
3

Custom mutation of styled components rules?

Has anyone ever been tempted to do something like the following: And just how much of a bad idea could it be? I'm wanting to use some custom functions (see styled-system) to apply an 'api' to the components. The use-case is to use styled to create a new component extending a…

thumbsup
0
message-simple
3

position of style

is there a way to position the style tag, whether to inject before header or body tag. https://github.com/styled-components/styled-components/issues/3181

thumbsup
0
message-simple
1

Project structure for evolution with Gatsby

Hello, I am working on a project with Gatsby and I would like to know what is the best solution for a folder architecture at the start knowing that the project is intended for constant evolution. I wonder if I should group the components and styles file in the same folder or…

thumbsup
0
message-simple
0

How to write style with parent class name in style component

For example <PrimaryButton> <ButText> primary button </ButText></PrimaryButton> <SecButton> <ButText> secondary button </ButText> </SecButton>

thumbsup
0
message-simple
6

Responsive (multiple screen sizes) layout in theme for styled-components?

I want to build a theme which has all the common styles which includes media queries For eg: theme = { …

thumbsup
1
message-simple
2