Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While importing scss file into parent class css not get added #2888

Closed
kumaresan-subramani opened this issue Aug 10, 2020 · 1 comment
Closed

Comments

@kumaresan-subramani
Copy link

HI Team,

Below is my scss file

.mat {
@import "ej2-base/styles/material.scss";
@import "ej2-buttons/styles/material.scss";
@import "ej2-popups/styles/material.scss";
@import "ej2-splitbuttons/styles/material.scss";
}
.boot{
    @import "ej2-base/styles/bootstrap.scss";
    @import "ej2-buttons/styles/bootstrap.scss";
    @import "ej2-popups/styles/bootstrap.scss";
    @import "ej2-splitbuttons/styles/bootstrap.scss";
}

In here, i want to load material theme while changing class to the body.But styles not get added

Here i have attched my sample
scsssIssue.zip

Repo steps

  • Download above sample

  • GIve npm i command then ng serve

  • you will see button in browser

  • Then click click me button - style wont get added'

if you chage scss like below

@import "ej2-base/styles/material.scss";
@import "ej2-buttons/styles/material.scss";
@import "ej2-popups/styles/material.scss";
@import "ej2-splitbuttons/styles/material.scss";

Style getting added properly

@Awjin
Copy link
Contributor

Awjin commented Aug 10, 2020

The Sass itself is correct. I believe this behavior is due to Angular's component style scoping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants