added standartized page header component
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<header class="page-header">
|
||||
<div class="page-header__copy">
|
||||
@if (eyebrow()) {
|
||||
<p class="page-header__eyebrow">{{ eyebrow() }}</p>
|
||||
}
|
||||
@if (title()) {
|
||||
@switch (level()) {
|
||||
@case (2) {
|
||||
<h2 class="page-header__title">{{ title() }}</h2>
|
||||
}
|
||||
@case (3) {
|
||||
<h3 class="page-header__title">{{ title() }}</h3>
|
||||
}
|
||||
@default {
|
||||
<h1 class="page-header__title">{{ title() }}</h1>
|
||||
}
|
||||
}
|
||||
}
|
||||
@if (subtitle()) {
|
||||
<p class="page-header__subtitle">{{ subtitle() }}</p>
|
||||
}
|
||||
<ng-content select="[pageMeta]"></ng-content>
|
||||
</div>
|
||||
<div class="page-header__actions">
|
||||
<ng-content select="[pageActions]"></ng-content>
|
||||
</div>
|
||||
</header>
|
||||
@@ -0,0 +1,81 @@
|
||||
:host {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page-header__copy {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.page-header__eyebrow {
|
||||
margin: 0 0 6px;
|
||||
color: var(--sg-text-soft);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.12em;
|
||||
line-height: 1.3;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.page-header__title {
|
||||
margin: 0;
|
||||
color: var(--sg-text);
|
||||
font-size: var(--sg-page-title-size, clamp(23px, 2vw, 28px));
|
||||
font-weight: var(--sg-page-title-weight, 700);
|
||||
letter-spacing: var(--sg-page-title-letter-spacing, -0.02em);
|
||||
line-height: var(--sg-page-title-line-height, 1.18);
|
||||
}
|
||||
|
||||
h2.page-header__title {
|
||||
font-size: var(--sg-section-title-size, clamp(17px, 1.3vw, 19px));
|
||||
font-weight: var(--sg-section-title-weight, 700);
|
||||
letter-spacing: var(--sg-section-title-letter-spacing, -0.01em);
|
||||
line-height: var(--sg-section-title-line-height, 1.3);
|
||||
}
|
||||
|
||||
h3.page-header__title {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.page-header__subtitle {
|
||||
max-width: 90ch;
|
||||
margin: 6px 0 0;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.page-header__actions {
|
||||
display: flex;
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.page-header {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.page-header__actions {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
h1.page-header__title {
|
||||
font-size: 23px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
|
||||
/** Shared heading block for pages and page sections. */
|
||||
@Component({
|
||||
selector: 'app-page-header',
|
||||
standalone: true,
|
||||
templateUrl: './page-header.component.html',
|
||||
styleUrl: './page-header.component.scss',
|
||||
})
|
||||
export class PageHeaderComponent {
|
||||
readonly title = input<string | null>(null);
|
||||
readonly subtitle = input<string | null>(null);
|
||||
readonly eyebrow = input<string | null>(null);
|
||||
readonly level = input<1 | 2 | 3>(1);
|
||||
}
|
||||
Reference in New Issue
Block a user