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

Simplify styled-components + Inject css to document.head #79

Merged
merged 8 commits into from
May 6, 2022

Conversation

nvh95
Copy link
Owner

@nvh95 nvh95 commented Apr 24, 2022

Features

  • Do not need to write styled-component's CSS to disk (cache folder)
  • Inject style to head, instead of body
  • Add tests for current styling strategies

Chores

  • Rename script npm run test:only to npm run test:dev

@netlify
Copy link

netlify bot commented Apr 24, 2022

Deploy Preview for jest-preview-library canceled.

Name Link
🔨 Latest commit bd1fbea
🔍 Latest deploy log https://app.netlify.com/sites/jest-preview-library/deploys/6274fb3773631b0008890820

@nvh95 nvh95 changed the title chore: Add comments to simplify support for styled-components Simplify styled-components + Inject css to document.head Apr 24, 2022
@nvh95 nvh95 self-assigned this May 3, 2022
@nvh95 nvh95 force-pushed the styled-components-simplify branch from 37325a1 to 200c76f Compare May 4, 2022 15:55
@nvh95 nvh95 requested review from ntt261298 and sonngdev May 4, 2022 15:55
@nvh95 nvh95 marked this pull request as ready for review May 4, 2022 16:02
@@ -10,21 +10,11 @@ export function debug(element: Element = document.body): void {
});
}

// If user use styled-components
if (getStyle) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we safely remove ./styled-components now?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure. I will remove that.
We don't need to access to styled-component's internal to make jest preview works anymore. But at least I learned a lot of how styled-components works

@nvh95 nvh95 merged commit 9775308 into main May 6, 2022
@nvh95 nvh95 deleted the styled-components-simplify branch May 6, 2022 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inject css to document.head, not document.body Simplify styled-components support
3 participants