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
)?
css angular
|
show 1 more comment
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
)?
css angular
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 dong serve
again?
– user184994
Nov 10 at 13:18
|
show 1 more comment
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
)?
css angular
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
css angular
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 dong serve
again?
– user184994
Nov 10 at 13:18
|
show 1 more comment
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 dong 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
|
show 1 more comment
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
add a comment |
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
add a comment |
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
add a comment |
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
Changes to angular.json
are not picked up automatically.
You will need to stop the app, and do ng serve
again
answered Nov 10 at 13:20
user184994
10.9k11627
10.9k11627
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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