Angular Styling
import { Component, ViewEncapsulation } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
@Component({
selector: 'app-card',
standalone: true,
encapsulation: ViewEncapsulation.Emulated,
template: `
<div class="card">
<h3>{{ title }}</h3>
<p><ng-content></ng-content></p>
</div>
`,
styles: [`
.card {
border: 1px solid #ddd;
border-radius: 8px;
padding: 1rem;
}
h3 {
margin: 0 0 0.5rem;
color: #2c3e50;
}
`]
})
export class CardComponent {
title = 'Default Title';
}
bootstrapApplication(CardComponent).catch((err) => console.error(err));