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.

CSS is always injected

See original GitHub issue

Hello,

i tried to disable injecting css with directive injectCSS: false but css is always injected with map init.

Test: in example/src/demos/heatmap.tsx changed line 9 to: const Map = ReactMapboxGl({ accessToken: token, injectCSS: false });

Screenshot with injectCSS: false image

Always tested on production: React: 16.5.2 Mapbox: 0.50 React-Mapbox: 4.0

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

15reactions
JClackettcommented, Apr 13, 2020

this also doesnt play well with the new Next.js version where you HAVE to import css fils in _app. Only solution is to use the, now not recommended, @zeit/next-css plugin…

8reactions
sheeruncommented, Feb 11, 2019

Pleeeese remove this require from code… It just doesn’t play well with bundlers.

I don’t want to use this built-in .css I have my own. And now it’s nearly impossible for me to make webpack ignore this css require from react-mapbox-gl so there is no duplicate css bundled

Read more comments on GitHub >

github_iconTop Results From Across the Web

Style Injection is for Winners | CSS-Tricks
The ability to inject newly-modified CSS on every file change (without reloading the page) is the type of workflow-enhancement that you never ...
Read more >
What is CSS injection and how to prevent it? - Stack Overflow
CSS injection means that an attacker manages to upload malicious CSS code to your website which will run on your visitors browsers. Is...
Read more >
CSS already injected - Google Groups
When injecting Blockly, you can choose to not inject CSS: ... It's always really nice to come back to an old question and...
Read more >
The Fourth Way to Inject CSS - Dan Q
Every one of Jeremy's suggestions involve adding markup to the HTML document itself. Which makes sense; you almost always want to associate ...
Read more >
дэн on Twitter: "Misconception: “inline styles” always means ...
Misconception: “inline styles” always means using DOM .style API. Reality: many “inline styles” libraries work by injecting CSS rule sheets.
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