Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to write full path to a component's file in className #209

Open
rifler opened this issue Feb 19, 2019 · 3 comments
Open

Ability to write full path to a component's file in className #209

rifler opened this issue Feb 19, 2019 · 3 comments

Comments

@rifler
Copy link

rifler commented Feb 19, 2019

Hi there!

Our common pattern is to write template in index.tsx (or view.tsx) and styles in styles.tsx. So the most common component dir structure looks like:
client/components/AwesomeComponent:

  • index.tsx
  • styles.tsx

That's why classes looks like styles__Header-sc-1ei6mxn-18 and you can't easily identify what Header is it, from Component1/styles.tsx or from Component2/styles.tsx. It would be great for us to write full path to a file from cwd in className, like so client_components_component1_styles__Header-sc-1ei6mxn-18.

What do you think?

btw we absolutely love styled components

@quantizor
Copy link
Collaborator

What do you think @mxstbr? My only concern is this could greatly increase the payload size of both the CSS and the HTML, though some of it would get gzipped away. Perhaps it could make sense behind a flag that isn't enabled by default.

@rifler
Copy link
Author

rifler commented Jun 26, 2019

+1 for flag, it should be used in development only

@elie222
Copy link

elie222 commented Nov 11, 2019

I added a flag for it in this PR:
#259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants