Component Styles
noun
say it: “kum-POH-nent STYLEZ” /kəmˈpoʊnənt staɪlz/
CSS that belongs to one Angular component and doesn't leak into others.
What is Component Styles?
Component styles are CSS that belongs to one component. By default Angular keeps them from leaking out, so .title in one component doesn't affect another.
@Component({
selector: 'app-badge',
template: `<span class="badge">New</span>`,
styles: `.badge { background: gold; padding: 2px 6px; }`,
})
export class Badge {}
In a sentence
- “The card's component styles make its h2 small without changing any other heading.”
Level: Novice · More Angular terms at this level
Updated