import css based on condition in styles.css angular 7
up vote
0
down vote
favorite
How to import css based on condition like below,
Angular7
In styles.css
if (data === 'mobile') {
@import './assets/css/common1.css';
} else {
@import './assets/css/common2.css';
}
My problem is:
I have two modules which loads different application in my project.
{
path : ''
loadChildren: Module1
}
{
path : 'ng7'
loadChildren: Module2
}
Here, I want to use Module 1 - common1.css and Module 2 - common2.css
angular angular7
|
show 1 more comment
up vote
0
down vote
favorite
How to import css based on condition like below,
Angular7
In styles.css
if (data === 'mobile') {
@import './assets/css/common1.css';
} else {
@import './assets/css/common2.css';
}
My problem is:
I have two modules which loads different application in my project.
{
path : ''
loadChildren: Module1
}
{
path : 'ng7'
loadChildren: Module2
}
Here, I want to use Module 1 - common1.css and Module 2 - common2.css
angular angular7
try stackoverflow.com/questions/42824472/…
– Alok Deshwal
Nov 10 at 16:20
1
Possible duplicate of angular2: how to manually add css files by condition to index.html?
– SiddAjmera
Nov 10 at 16:25
No Alok Deshwal. I tried . But my problem is to add only one css based on condition.
– Satzz
Nov 10 at 16:26
Sceanrio: module1 need to load common1.css and module2 need to load common2.css. These 2 different application in my project
– Satzz
Nov 10 at 16:28
If you are loading the modules dynamically, then add css files using "styleUrls" to the associated components of module.
– Aparna
Nov 10 at 17:38
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How to import css based on condition like below,
Angular7
In styles.css
if (data === 'mobile') {
@import './assets/css/common1.css';
} else {
@import './assets/css/common2.css';
}
My problem is:
I have two modules which loads different application in my project.
{
path : ''
loadChildren: Module1
}
{
path : 'ng7'
loadChildren: Module2
}
Here, I want to use Module 1 - common1.css and Module 2 - common2.css
angular angular7
How to import css based on condition like below,
Angular7
In styles.css
if (data === 'mobile') {
@import './assets/css/common1.css';
} else {
@import './assets/css/common2.css';
}
My problem is:
I have two modules which loads different application in my project.
{
path : ''
loadChildren: Module1
}
{
path : 'ng7'
loadChildren: Module2
}
Here, I want to use Module 1 - common1.css and Module 2 - common2.css
angular angular7
angular angular7
edited Nov 10 at 17:14
HDJEMAI
4,051123653
4,051123653
asked Nov 10 at 16:13
Satzz
276
276
try stackoverflow.com/questions/42824472/…
– Alok Deshwal
Nov 10 at 16:20
1
Possible duplicate of angular2: how to manually add css files by condition to index.html?
– SiddAjmera
Nov 10 at 16:25
No Alok Deshwal. I tried . But my problem is to add only one css based on condition.
– Satzz
Nov 10 at 16:26
Sceanrio: module1 need to load common1.css and module2 need to load common2.css. These 2 different application in my project
– Satzz
Nov 10 at 16:28
If you are loading the modules dynamically, then add css files using "styleUrls" to the associated components of module.
– Aparna
Nov 10 at 17:38
|
show 1 more comment
try stackoverflow.com/questions/42824472/…
– Alok Deshwal
Nov 10 at 16:20
1
Possible duplicate of angular2: how to manually add css files by condition to index.html?
– SiddAjmera
Nov 10 at 16:25
No Alok Deshwal. I tried . But my problem is to add only one css based on condition.
– Satzz
Nov 10 at 16:26
Sceanrio: module1 need to load common1.css and module2 need to load common2.css. These 2 different application in my project
– Satzz
Nov 10 at 16:28
If you are loading the modules dynamically, then add css files using "styleUrls" to the associated components of module.
– Aparna
Nov 10 at 17:38
try stackoverflow.com/questions/42824472/…
– Alok Deshwal
Nov 10 at 16:20
try stackoverflow.com/questions/42824472/…
– Alok Deshwal
Nov 10 at 16:20
1
1
Possible duplicate of angular2: how to manually add css files by condition to index.html?
– SiddAjmera
Nov 10 at 16:25
Possible duplicate of angular2: how to manually add css files by condition to index.html?
– SiddAjmera
Nov 10 at 16:25
No Alok Deshwal. I tried . But my problem is to add only one css based on condition.
– Satzz
Nov 10 at 16:26
No Alok Deshwal. I tried . But my problem is to add only one css based on condition.
– Satzz
Nov 10 at 16:26
Sceanrio: module1 need to load common1.css and module2 need to load common2.css. These 2 different application in my project
– Satzz
Nov 10 at 16:28
Sceanrio: module1 need to load common1.css and module2 need to load common2.css. These 2 different application in my project
– Satzz
Nov 10 at 16:28
If you are loading the modules dynamically, then add css files using "styleUrls" to the associated components of module.
– Aparna
Nov 10 at 17:38
If you are loading the modules dynamically, then add css files using "styleUrls" to the associated components of module.
– Aparna
Nov 10 at 17:38
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f53240852%2fimport-css-based-on-condition-in-styles-css-angular-7%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
try stackoverflow.com/questions/42824472/…
– Alok Deshwal
Nov 10 at 16:20
1
Possible duplicate of angular2: how to manually add css files by condition to index.html?
– SiddAjmera
Nov 10 at 16:25
No Alok Deshwal. I tried . But my problem is to add only one css based on condition.
– Satzz
Nov 10 at 16:26
Sceanrio: module1 need to load common1.css and module2 need to load common2.css. These 2 different application in my project
– Satzz
Nov 10 at 16:28
If you are loading the modules dynamically, then add css files using "styleUrls" to the associated components of module.
– Aparna
Nov 10 at 17:38