Is it possible to create more than one global CSS file in Angular?









up vote
2
down vote

favorite












I would have two global CSS files in my application, so I try to do it by:



  • creating new file (as sibling of styles.css in the folder structure)

  • add lines in angular.json in: "build" -> "styles" and "test" -> "styles".

Unfortunately it doesn't work, so my question is: did I make something wrong or is it impossible to have two global CSS files supported by Angular (I skipped option with adding css file in index.html)?










share|improve this question





















  • Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
    – user184994
    Nov 10 at 13:00











  • 1. I didn't see in debugger->web to see that my file is downloaded. 2. Class-style didn't apply (I even tried to paste same style in styles.css to compare and style is good).
    – 3D_fun
    Nov 10 at 13:03






  • 1




    I don't think you will see it being downloaded, because I believe the build process adds it into the index.html file
    – user184994
    Nov 10 at 13:05










  • File 'styles.css' is visible in debugger so I think my own should be too. I test method from source post in stackblitz and there it works. I don't know what the difference in my app that it doesn't work.
    – 3D_fun
    Nov 10 at 13:09










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    Nov 10 at 13:18














up vote
2
down vote

favorite












I would have two global CSS files in my application, so I try to do it by:



  • creating new file (as sibling of styles.css in the folder structure)

  • add lines in angular.json in: "build" -> "styles" and "test" -> "styles".

Unfortunately it doesn't work, so my question is: did I make something wrong or is it impossible to have two global CSS files supported by Angular (I skipped option with adding css file in index.html)?










share|improve this question





















  • Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
    – user184994
    Nov 10 at 13:00











  • 1. I didn't see in debugger->web to see that my file is downloaded. 2. Class-style didn't apply (I even tried to paste same style in styles.css to compare and style is good).
    – 3D_fun
    Nov 10 at 13:03






  • 1




    I don't think you will see it being downloaded, because I believe the build process adds it into the index.html file
    – user184994
    Nov 10 at 13:05










  • File 'styles.css' is visible in debugger so I think my own should be too. I test method from source post in stackblitz and there it works. I don't know what the difference in my app that it doesn't work.
    – 3D_fun
    Nov 10 at 13:09










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    Nov 10 at 13:18












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I would have two global CSS files in my application, so I try to do it by:



  • creating new file (as sibling of styles.css in the folder structure)

  • add lines in angular.json in: "build" -> "styles" and "test" -> "styles".

Unfortunately it doesn't work, so my question is: did I make something wrong or is it impossible to have two global CSS files supported by Angular (I skipped option with adding css file in index.html)?










share|improve this question













I would have two global CSS files in my application, so I try to do it by:



  • creating new file (as sibling of styles.css in the folder structure)

  • add lines in angular.json in: "build" -> "styles" and "test" -> "styles".

Unfortunately it doesn't work, so my question is: did I make something wrong or is it impossible to have two global CSS files supported by Angular (I skipped option with adding css file in index.html)?







css angular






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 12:58









3D_fun

878




878











  • Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
    – user184994
    Nov 10 at 13:00











  • 1. I didn't see in debugger->web to see that my file is downloaded. 2. Class-style didn't apply (I even tried to paste same style in styles.css to compare and style is good).
    – 3D_fun
    Nov 10 at 13:03






  • 1




    I don't think you will see it being downloaded, because I believe the build process adds it into the index.html file
    – user184994
    Nov 10 at 13:05










  • File 'styles.css' is visible in debugger so I think my own should be too. I test method from source post in stackblitz and there it works. I don't know what the difference in my app that it doesn't work.
    – 3D_fun
    Nov 10 at 13:09










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    Nov 10 at 13:18
















  • Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
    – user184994
    Nov 10 at 13:00











  • 1. I didn't see in debugger->web to see that my file is downloaded. 2. Class-style didn't apply (I even tried to paste same style in styles.css to compare and style is good).
    – 3D_fun
    Nov 10 at 13:03






  • 1




    I don't think you will see it being downloaded, because I believe the build process adds it into the index.html file
    – user184994
    Nov 10 at 13:05










  • File 'styles.css' is visible in debugger so I think my own should be too. I test method from source post in stackblitz and there it works. I don't know what the difference in my app that it doesn't work.
    – 3D_fun
    Nov 10 at 13:09










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    Nov 10 at 13:18















Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
– user184994
Nov 10 at 13:00





Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
– user184994
Nov 10 at 13:00













1. I didn't see in debugger->web to see that my file is downloaded. 2. Class-style didn't apply (I even tried to paste same style in styles.css to compare and style is good).
– 3D_fun
Nov 10 at 13:03




1. I didn't see in debugger->web to see that my file is downloaded. 2. Class-style didn't apply (I even tried to paste same style in styles.css to compare and style is good).
– 3D_fun
Nov 10 at 13:03




1




1




I don't think you will see it being downloaded, because I believe the build process adds it into the index.html file
– user184994
Nov 10 at 13:05




I don't think you will see it being downloaded, because I believe the build process adds it into the index.html file
– user184994
Nov 10 at 13:05












File 'styles.css' is visible in debugger so I think my own should be too. I test method from source post in stackblitz and there it works. I don't know what the difference in my app that it doesn't work.
– 3D_fun
Nov 10 at 13:09




File 'styles.css' is visible in debugger so I think my own should be too. I test method from source post in stackblitz and there it works. I don't know what the difference in my app that it doesn't work.
– 3D_fun
Nov 10 at 13:09












Did you make sure to stop the app, and do ng serve again?
– user184994
Nov 10 at 13:18




Did you make sure to stop the app, and do ng serve again?
– user184994
Nov 10 at 13:18












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Changes to angular.json are not picked up automatically.



You will need to stop the app, and do ng serve again






share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239187%2fis-it-possible-to-create-more-than-one-global-css-file-in-angular%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    Changes to angular.json are not picked up automatically.



    You will need to stop the app, and do ng serve again






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      Changes to angular.json are not picked up automatically.



      You will need to stop the app, and do ng serve again






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Changes to angular.json are not picked up automatically.



        You will need to stop the app, and do ng serve again






        share|improve this answer












        Changes to angular.json are not picked up automatically.



        You will need to stop the app, and do ng serve again







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 10 at 13:20









        user184994

        10.9k11627




        10.9k11627



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239187%2fis-it-possible-to-create-more-than-one-global-css-file-in-angular%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo