Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

More angular-cli way to load the ArcGIS (and font?) CSS #22

Closed

Description

@tomwayson

Currently we add a link to the CDN stylesheet in index.html.

That works, but a more angular-cli way to do it would probably be to add them to the apps[0].styles array.

Activity

  1. tomwayson commented on Dec 20, 2016

    @tomwayson
    OwnerAuthor

    Would also want to update the sentance under the goal section of the README with the required steps. The preceding paragraph and the new instructions should probably become their own section called "How it works".

  2. self-assigned this
    on Feb 1, 2017
  3. jwasilgeo commented on Feb 1, 2017

    @jwasilgeo
    Collaborator

    @tomwayson I have begun to look into this, and admittedly only with a half hour spent on it so far, I've had luck with @imports in the main styles.css, rather than adding full hrefs to the apps[0].styles array. For example:

    @import '~@angular/material/core/theming/prebuilt/indigo-pink.css';
    
    @import '//js.arcgis.com/4.2/esri/css/main.css';
    
    @import '//fonts.googleapis.com/icon?family=Material+Icons';
    
    html, body {
    ...
    ...

    Then, these get added to the DOM:
    image

    I'll look a bit more at the angular-cli source to see if there's a way to define links in the angular-cli.json.

  4. TheKeithStewart commented on Feb 1, 2017

    @TheKeithStewart
    Collaborator

    @tomwayson and @jwasilgeo, looking at the getting started guide for the Angular Material 2 project it looks like the recommendation for adding the font icons styles is in the index.html even in an Angular CLI app. I would assume this would go for any remote libraries that you wanted included (i.e. main.css from arcgis.com).

    As for things like the theming CSS that you would be grabbing from local files in the node_modules directory using the @import statement like this seems appropriate. Another reference for that can be found in the Angular Material 2 Theming Guide.

  5. jwasilgeo commented on Feb 1, 2017

    @jwasilgeo
    Collaborator

    Interesting, thanks for pointing all that out, @kgs916.

    How do y'all want to proceed?

  6. tomwayson commented on Feb 1, 2017

    @tomwayson
    OwnerAuthor

    Thanks guys.

    @import statements work for me - less ✨magic✨. Main thing I care about are:

    1. getting them out of index.html
    2. doc'ing in the readme where to add them
  7. jwasilgeo commented on Feb 1, 2017

    @jwasilgeo
    Collaborator

    On it.

  8. added a commit that references this issue on Feb 1, 2017
    3b7b18a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions