Styles

@Component({
    styles: [`
        body{ color: red }
    `
    ],
    styleUrls: ['css/bootstrap.css', 'css/timesheet.css'];
})

Binding style on Host element ( selector )

<child-component></child-component>
@Component({
    selector: 'child-component',
    // class="odd even" added to `child-component` component
    styles: [`
        :host.add{
            color: red;
        }

        :host.even{
            color: green;
        }
    `
    ]
})

Last updated

Was this helpful?