Skip to content

Commit

Permalink
page header tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-ErikaMcVey committed Jan 15, 2025
1 parent 37e2173 commit 1781298
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-overrides('sky-page-header-actions') {
--sky-override-page-header-actions-button-space-bottom: var(
--sky-margin-stacked-sm
);
--sky-override-page-header-actions-button-space-right: var(
--sky-margin-inline-sm
);
--sky-override-page-header-actions-space-bottom: calc(
var(--sky-margin-stacked-sm) * -1
);
--sky-override-page-header-actions-space-top: var(--sky-margin-stacked-xl);
}

sky-page-header-actions {
display: block;

&:not(:empty) {
margin-top: var(--sky-margin-stacked-xl);
margin-top: var(
--sky-override-page-header-actions-space-top,
var(--sky-space-stacked-xl)
);
// Negate the bottom margin of the last row of buttons so it doesn't create extra
// vertical space between the actions and the page content.
margin-bottom: calc(var(--sky-margin-stacked-sm) * -1);
margin-bottom: var(
--sky-override-page-header-actions-space-bottom,
calc(var(--sky-space-stacked-s) * -1)
);
}

> sky-dropdown {
Expand All @@ -16,13 +37,19 @@ sky-page-header-actions {
// inside the dropdown.
> :is(.sky-btn, sky-dropdown) {
// Vertical space between rows of buttons that have wrapped.
margin-bottom: var(--sky-margin-stacked-sm);
margin-bottom: var(
--sky-override-page-header-actions-button-space-bottom,
var(--sky-space-stacked-s)
);

&:not(:last-child) {
// Horizontal space between buttons on the same row. Use margin-right so that
// extra horizontal space is not added to the first button that wraps to the
// next line.
margin-right: var(--sky-margin-inline-sm);
margin-right: var(
--sky-override-page-header-actions-button-space-right,
var(--sky-space-gap-action_group-m)
);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-host-overrides() {
--sky-override-page-header-alert-space-below: var(--sky-margin-stacked-lg);
--sky-override-page-header-alert-space-between: var(--sky-margin-stacked-lg);
}

:host {
display: block;

&:not(:empty) {
margin-bottom: var(--sky-margin-stacked-lg);
margin-bottom: var(
--sky-override-page-header-alert-space-below,
var(--sky-space-stacked-l)
);

::ng-deep {
sky-alert + sky-alert {
margin-top: var(--sky-margin-stacked-lg);
margin-top: var(
--sky-override-page-header-alert-space-between,
var(--sky-space-stacked-l)
);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

/**
* Displays alerts within the page header and applies spacing between alerts. Appears above the page title.
Expand All @@ -8,5 +9,6 @@ import { Component } from '@angular/core';
templateUrl: './page-header-alerts.component.html',
styleUrls: ['./page-header-alerts.component.scss'],
standalone: false,
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyPageHeaderAlertsComponent {}
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
@use 'libs/components/theme/src/lib/styles/mixins' as mixins;
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-host-overrides() {
--sky-override-page-header-avatar-space-above: 5px;
--sky-override-page-header-avatar-space-right-sm: var(--sky-margin-inline-lg);
--sky-override-page-header-avatar-space-right-xs: var(--sky-margin-inline-sm);
}

:host {
display: block;

&:not(:empty) {
padding-top: 5px;
margin-right: var(--sky-margin-inline-sm);
padding-top: var(
--sky-override-page-header-avatar-space-above,
var(--sky-space-stacked-xs)
);
margin-right: var(
--sky-override-page-header-avatar-space-right-xs,
var(--sky-space-inline-s)
);
}
}

@include mixins.sky-host-responsive-container-sm-min() {
&:not(:empty) {
margin-right: var(--sky-margin-inline-lg);
margin-right: var(
--sky-override-page-header-avatar-space-right-sm,
var(--sky-space-inline-l)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { SkyDefaultInputProvider, SkyMediaQueryService } from '@skyux/core';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

/**
* Displays an avatar within the page header to the left of the page title.
Expand All @@ -13,6 +14,7 @@ import { SkyDefaultInputProvider, SkyMediaQueryService } from '@skyux/core';
styleUrls: ['./page-header-avatar.component.scss'],
providers: [SkyDefaultInputProvider],
standalone: false,
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyPageHeaderAvatarComponent {
constructor() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-host-overrides() {
--sky-override-page-header-details-space-above: var(--sky-margin-stacked-sm);
}

:host {
display: block;

&:not(:empty) {
margin-top: var(--sky-margin-stacked-sm);
margin-top: var(
--sky-override-page-header-details-space-above,
var(--sky-space-stacked-s)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

/**
* Displays additional information in the page header, like record details.
Expand All @@ -9,5 +10,6 @@ import { Component } from '@angular/core';
templateUrl: './page-header-details.component.html',
styleUrls: ['./page-header-details.component.scss'],
standalone: false,
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyPageHeaderDetailsComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-overrides('.sky-page-header') {
--sky-override-page-header-hub-spoke-spacing: #{$sky-space-md};
--sky-override-page-header-chevron-size: 16px;
--sky-override-page-header-chevron-color: var(--sky-text-color-default);
--sky-override-page-header-chevron-size: 16px;
--sky-override-page-header-hub-spoke-spacing: #{$sky-space-md};
--sky-override-page-header-parent-color: #{$sky-text-color-action-primary};
}

Expand Down
32 changes: 28 additions & 4 deletions libs/components/theme/src/lib/styles/_layout-host.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
--sky-margin-stacked-xl
)
var(--sky-margin-inline-sm);
--sky-override-page-header-avatar-size-space: var(--sky-margin-inline-xl);
--sky-override-page-header-link-rows-space: var(--sky-margin-stacked-xl);
--sky-override-page-header-spacing-xs: 20px 10px;
}

Expand Down Expand Up @@ -202,15 +204,37 @@
'header-avatar header-content links'
'content content links';
grid-template-rows:
minmax(var(--sky-margin-stacked-xl), min-content)
minmax(var(--sky-margin-stacked-xl), min-content)
minmax(var(--sky-margin-stacked-xl), min-content)
minmax(
var(
--sky-override-page-header-link-rows-space,
var(--sky-space-stacked-xl)
),
min-content
)
minmax(
var(
--sky-override-page-header-link-rows-space,
var(--sky-space-stacked-xl)
),
min-content
)
minmax(
var(
--sky-override-page-header-link-rows-space,
var(--sky-space-stacked-xl)
),
min-content
)
auto;
grid-template-columns: 0 75% 25%;

&:has(sky-page-header-avatar:not(:empty)) {
--sky-layout-host-header-avatar-size: calc(
120px + var(--sky-margin-inline-xl)
120px +
var(
--sky-override-page-header-avatar-size-space,
var(--sky-space-inline-xl)
)
);
grid-template-columns:
var(--sky-layout-host-header-avatar-size)
Expand Down

0 comments on commit 1781298

Please sign in to comment.