question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to provide app css from a component

See original GitHub issue

I just came across jest-preview and it’s amazing! We use emotion and it’s really sweet how great our components look with basically 2 minutes of work.

One thing that’d be great is the ability to provide our app-level CSS, which for us is still injected by emotion, but in our top index.tsx file, i.e.:

ReactDOM.render(
  <ApolloProvider client={apolloClient}>
    <Router>
      <CssBaseline />
      <CssReset />
      <App />
    </Router>
  </ApolloProvider>,
  document.getElementById("root"),
);

The docs (which are great) have examples of adding root-/app-level externalCss from bootstap.min.css files; is there a way to do this same sort of externalCss but by pointing jest-preview at a React component that includes our CssBaseline and CssReset?

Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stephenhcommented, Jun 11, 2022

@nvh95 huh, I guess that is obvious in retrospect 😃, but yeah, we already use a custom render approach, we just historically have not included our CssBaseline/CssReset because they weren’t required for anything that tests needed to assert against. But yeah, we can do that; thanks!

0reactions
nvh95commented, Jun 11, 2022

@stephenh It’s super helpful. I will take a look in the morning my time. Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Style Your React App – 5 Ways to Write CSS in 2021
When it comes to styling your React app, you have a ton of different options. Which do you choose? I have broken down...
Read more >
CSS Element - Power Apps | Microsoft Learn
CSS describes how code components are to be displayed on UI. Available for. Model-driven and canvas apps. Parameters. Name, Description, Type ...
Read more >
CSS style from app.component.css not getting applied to the ...
In my app.component.css file I changed it to ... root directory ( where the main.ts is ) there's a style.css or style.scss (...
Read more >
Different Ways to Write CSS in React
Use CSS Modules · Create a file with .module.css as the extension. · Import that module into the React app (like we saw...
Read more >
The State of CSS in Angular
Styling applications is a critical part of delivering great experiences for users. Across the web we have Cascading Style Sheets (CSS) as a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found