This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Alaa Courdova
Problem
repeating a style is common while coding , for example: - container , font-style buttons ..etc.
As angular component is separated (CSS and HTML) , We face a repetitive code and if we need to change a style we needs to change many time for minor change -maybe-
✨Solution
styleUrls: ['./component1.scss',
'../component2.scss']
@Component({
selector: 'component',
templateUrl: './component.html',
styleUrls: ['./component1.scss',
'../component2.scss']
})
export class Component implements OnInit {
ngOnInit(): void {
}
}
so if the style we need is existing in a different component we can add the path of CSS , better than copying the style code
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Alaa Courdova

Alaa Courdova | Sciencx (2023-01-29T16:35:49+00:00) Using Styles and StyleUrls Component Properties in Angular. Retrieved from https://www.scien.cx/2023/01/29/using-styles-and-styleurls-component-properties-in-angular/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.