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.

loadScript has option to also create JSAPI css link tag(s)

See original GitHub issue

How about getting the bootstrap method to also generate a CSS <link> tag when it creates the JS <script> tag? Could lead to fewer steps for consuming developers to have to remember to deal with.

https://github.com/tomwayson/esri-loader/blob/master/index.ts#L20

Perhaps the options could be extended to include not only the JS url but also the CSS url? This would be helpful since the CSS url has different structures throughout the different incarnations of JSAPI 3.x and 4.x. Something like: options.cssUrl = 'https://js.arcgis.com/4.2/esri/css/main.css';

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
tomwaysoncommented, Mar 28, 2019

As of #163 most of the features discussed in this issue have been implemented. The remaining ones will be handled in new issues (like #157).

2reactions
tomwaysoncommented, Feb 13, 2017

Or we could do some elegant thing w/ a css option that would replace includeCss and cssUrls:

  • falsey means don’t do any css loading
  • true means figure out default path based on version or url and include
  • true plus theme: 'calcite' means figure out default path to theme and include that too
  • an Array means load each as a url

If theme is supplied but css is falsey, theme is ignored.

I kind of like that better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Required CSS | Guide | ArcGIS API for JavaScript 3.42
Dynamically appending CSS files makes overriding default styles cumbersome because CSS included via a link or style tag is parsed before JavaScript appends...
Read more >
esri-loader - npm
A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications. Latest version: 3.6.0, last published: 3 months ago.
Read more >
Overview | Maps JavaScript API - Google Developers
Get started with the Google Maps JavaScript API. View a simple example, learn the concepts, and create custom maps for your site.
Read more >
Dynamically loading an external JavaScript or CSS file
To load a .js or .css file dynamically, in a nutshell, it means using DOM methods to first create a swanky new "...
Read more >
React Google Maps Api Style Guide
Once you have a key (if it is url restricted, make sure it allows this url), ... LoadScript - Loads the Google Maps...
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