loadScript has option to also create JSAPI css link tag(s)
See original GitHub issueHow 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:
- Created 7 years ago
- Comments:20 (20 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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).
Or we could do some elegant thing w/ a
css
option that would replaceincludeCss
andcssUrls
:true
means figure out default path based onversion
orurl
and includetrue
plustheme: 'calcite'
means figure out default path to theme and include that tooArray
means load each as a urlIf
theme
is supplied butcss
is falsey, theme is ignored.I kind of like that better.