Skip to content

Instantly share code, notes, and snippets.

@hollygood
Last active April 17, 2019 19:30
Show Gist options
  • Save hollygood/56bc978992dbacebd588fab3ab29fbbc to your computer and use it in GitHub Desktop.
Save hollygood/56bc978992dbacebd588fab3ab29fbbc to your computer and use it in GitHub Desktop.
Angular 6 change library style in project

Change Style from Angular Library

If we create a library for reusable components with Angular 6, and you'll find that it's not possible to update the styles from the library. One way to do that is put ':host ::ng-deep':

// from library
.example-class {
   font-weight: bold;
}

// in app
:host ::ng-deep .example-class {
  font-weight: normal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment