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











up vote
1
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
    2 days ago












  • 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
    2 days ago






  • 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
    2 days ago










  • 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
    2 days ago










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    2 days ago















up vote
1
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
    2 days ago












  • 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
    2 days ago






  • 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
    2 days ago










  • 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
    2 days ago










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    2 days ago













up vote
1
down vote

favorite









up vote
1
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 2 days ago









3D_fun

808




808












  • Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
    – user184994
    2 days ago












  • 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
    2 days ago






  • 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
    2 days ago










  • 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
    2 days ago










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    2 days ago


















  • Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
    – user184994
    2 days ago












  • 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
    2 days ago






  • 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
    2 days ago










  • 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
    2 days ago










  • Did you make sure to stop the app, and do ng serve again?
    – user184994
    2 days ago
















Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
– user184994
2 days ago






Seems to work fine in a StackBlitz stackblitz.com/edit/angular-wvje8u?file=angular.json
– user184994
2 days ago














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
2 days ago




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
2 days ago




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
2 days ago




I don't think you will see it being downloaded, because I believe the build process adds it into the index.html file
– user184994
2 days ago












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
2 days ago




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
2 days ago












Did you make sure to stop the app, and do ng serve again?
– user184994
2 days ago




Did you make sure to stop the app, and do ng serve again?
– user184994
2 days ago












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
































    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 2 days ago









        user184994

        10.5k11426




        10.5k11426






























             

            draft saved


            draft discarded



















































             


            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




















































































            Popular posts from this blog

            Bressuire

            Vorschmack

            Quarantine