简体   繁体   中英

Angular ::ng-deep not working in global style

I created a component with its style I inserted

::ng-deep .input-blue.mat-focused .mat-form-field-label {
  color: #6200EE !important;
}

works perfectly. However when I add this code to the global style to use it in all components not working.

The global style.css is just a plain, non-Angular, or at least non-encapsulated (that is its whole point) style sheet. Remove the ::ng-deep and just leave

.input-blue.mat-focused .mat-form-field-label {
  color: #6200EE !important;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM