Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Each version's section is written by the pull request that changes the version, from the pull requests merged since the previous version, as the [README](README.md#releases) says; other pull requests don't edit this file.

## 0.0.41

- `@noldova/ui.components.angular`: a `SiteLink` takes `isIconOnly`, false by default. A footer link with an icon and `isIconOnly` draws its icon alone, in a pointer target from the group's edge, named and tooltipped by its label, such as X beside its mark, and shows `toolbar-hover` on a face centred on the mark when hovered (#210).
- `@noldova/ui.components.angular`: `SiteFooterComponent` takes `finePrint`, plain text such as a trademark notice, drawn as the footer's last row in the kit's smallest text and `text-muted`; null, the default, for none (#212).

## 0.0.40

- `@noldova/ui.components.angular`: the site header takes `translucent`, true by default. False keeps the header in the window's color while the page scrolls under it, in place of 92% of it over a blur, for a documentation site whose readers read long text under it; the docs site turns it off (#208).
Expand Down
5 changes: 4 additions & 1 deletion documents/kit/site-footer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ Every site's footer has one look.
The content keeps to the [site header's](site-header.md) width and insets, 3.875rem from the footer's top (`--nol-site-footer-padding-block`) and 3.4375rem from its bottom (`--nol-site-footer-padding-end`).
At the start, the lockup, with the site's `wordmarkSize`, then an optional line 1.125rem under it (`--nol-site-footer-line-gap`), then the notice 3.5rem under that (`--nol-site-footer-notice-gap`), both at most 18rem wide (`--nol-site-footer-line-width`), then any content the site projects.
At the end, the link groups, 3rem apart (`--nol-site-footer-group-gap`), the last one ending at the content's end; when the footer is too narrow for both, the groups wrap under the lockup, 2rem from it (`--nol-site-footer-gap`).
A site that gives `finePrint`, such as a trademark notice, gets it as the last row, under the lockup and the groups, 2rem below them (`--nol-site-footer-gap`), across the content's width.
Each group's title is 0.5rem above its links, and the links are 0.625rem apart (`--nol-site-footer-link-gap`); each is at least the pointer target high and wide, so a one-letter link such as X is a whole target.
A link the site gives an `icon` draws it first, as a mask as high as its text, 0.5rem from its label, in `--nol-brand-mark` as the header's social marks are.
A link with an icon and `isIconOnly` draws the icon alone, from the group's edge in a pointer target, its label naming it for assistive technology and as its tooltip, such as X beside its mark; without an icon, a link always draws its label.
When the footer is at most 47.5rem wide, as on a phone, the content takes the phone insets, 2.75rem from the top (`--nol-site-footer-padding-block-phone`), and the groups are 2.5rem apart (`--nol-site-footer-group-gap-phone`). The theme still defines `--nol-site-footer-gap-phone` (1.5rem), the phone gap of the footer's former layout, but nothing in the kit reads it now.

## Text roles
Expand All @@ -23,6 +25,7 @@ The line: message, on a line 1.7 times its size (`--nol-site-footer-line-height`
The links: message, on the site's line (`--nol-site-line-height`), in `text`.
Group titles: message, on a line 1.6 times its size (`--nol-site-line-height`), in the mono font and capitals, in `text-muted`.
The notice: as the line.
The fine print: small, on a line 1.7 times its size (`--nol-site-footer-line-height`), in `text-muted`, the dimmest text color that keeps its contrast.

## Surface and behavior

Expand All @@ -32,5 +35,5 @@ The lockup is the site header's: one link home named for the product's home, suc
Each group is a navigation landmark named by its title; the current page's link is marked `aria-current="page"`.
The notice is `© <year>` and Noldova's logo, unless the site gives its own as plain text.
The logo is the kit's `assets/brand/noldova-wordmark.svg`, the file noldova.com's own header draws, drawn in the notice's color as high as its capitals (`1cap`), on its baseline, in the file's proportions; it links to https://noldova.com at the page's stage (see `SiteStageService`), named Noldova; the link takes clicks and taps across at least the pointer target high, drawn nowhere, so the notice's line keeps its height.
A hovered link is underlined in `text-strong`, and the notice's logo turns `text-strong`, and keyboard focus is an accent outline outside it.
A hovered link is underlined in `text-strong`, and one that draws its mark alone shows `toolbar-hover` on a face centred on the mark, as high and wide as the header's marks' face, which its keyboard focus outlines too, and the notice's logo turns `text-strong`, and keyboard focus is an accent outline outside it.
Under forced colors the wordmark, the product's name, the links' icons and the notice's logo are `LinkText`, and keyboard focus is a 2px `Highlight` outline.
11 changes: 10 additions & 1 deletion src/noldova.ui.components.angular/src/api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12310,15 +12310,24 @@ export declare class SiteLink {
*/
public readonly icon: string | null;

/**
* Whether a footer link with an icon draws the icon alone, its label then
* naming the link for assistive technology and as its tooltip, such as X
* beside its mark; false, the default, draws the label after the icon.
* A link with no icon always draws its label.
*/
public readonly isIconOnly: boolean;

/**
* Creates the link.
*
* @param label The text it shows.
* @param href Where it leads.
* @param isCurrent Whether it leads to the current page; false when left out.
* @param icon The address of an SVG drawn before the label; none when left out.
* @param isIconOnly Whether a footer link draws its icon alone; false when left out.
*/
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null);
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null, isIconOnly?: boolean);
}

/**
Expand Down
18 changes: 17 additions & 1 deletion src/noldova.ui.components.angular/src/api/site-footer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ export declare class SiteFooterComponent {
*/
public readonly notice: InputSignal<string | null>;

/**
* A line of fine print, such as a trademark notice, as plain text, drawn
* as its own row under everything else in the kit's smallest text and
* `text-muted`; null, the default, for none.
*/
public readonly finePrint: InputSignal<string | null>;

/**
* Whether the content keeps to the wider width of a documentation site;
* false, the default, keeps to the site's content width.
Expand Down Expand Up @@ -140,15 +147,24 @@ export declare class SiteLink {
*/
public readonly icon: string | null;

/**
* Whether a footer link with an icon draws the icon alone, its label then
* naming the link for assistive technology and as its tooltip, such as X
* beside its mark; false, the default, draws the label after the icon.
* A link with no icon always draws its label.
*/
public readonly isIconOnly: boolean;

/**
* Creates the link.
*
* @param label The text it shows.
* @param href Where it leads.
* @param isCurrent Whether it leads to the current page; false when left out.
* @param icon The address of an SVG drawn before the label; none when left out.
* @param isIconOnly Whether a footer link draws its icon alone; false when left out.
*/
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null);
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null, isIconOnly?: boolean);
}

/**
Expand Down
11 changes: 10 additions & 1 deletion src/noldova.ui.components.angular/src/api/site-header.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,24 @@ export declare class SiteLink {
*/
public readonly icon: string | null;

/**
* Whether a footer link with an icon draws the icon alone, its label then
* naming the link for assistive technology and as its tooltip, such as X
* beside its mark; false, the default, draws the label after the icon.
* A link with no icon always draws its label.
*/
public readonly isIconOnly: boolean;

/**
* Creates the link.
*
* @param label The text it shows.
* @param href Where it leads.
* @param isCurrent Whether it leads to the current page; false when left out.
* @param icon The address of an SVG drawn before the label; none when left out.
* @param isIconOnly Whether a footer link draws its icon alone; false when left out.
*/
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null);
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null, isIconOnly?: boolean);
}

/**
Expand Down
18 changes: 17 additions & 1 deletion src/noldova.ui.components.angular/src/api/site.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ export declare class SiteFooterComponent {
*/
public readonly notice: InputSignal<string | null>;

/**
* A line of fine print, such as a trademark notice, as plain text, drawn
* as its own row under everything else in the kit's smallest text and
* `text-muted`; null, the default, for none.
*/
public readonly finePrint: InputSignal<string | null>;

/**
* Whether the content keeps to the wider width of a documentation site;
* false, the default, keeps to the site's content width.
Expand Down Expand Up @@ -571,15 +578,24 @@ export declare class SiteLink {
*/
public readonly icon: string | null;

/**
* Whether a footer link with an icon draws the icon alone, its label then
* naming the link for assistive technology and as its tooltip, such as X
* beside its mark; false, the default, draws the label after the icon.
* A link with no icon always draws its label.
*/
public readonly isIconOnly: boolean;

/**
* Creates the link.
*
* @param label The text it shows.
* @param href Where it leads.
* @param isCurrent Whether it leads to the current page; false when left out.
* @param icon The address of an SVG drawn before the label; none when left out.
* @param isIconOnly Whether a footer link draws its icon alone; false when left out.
*/
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null);
public constructor(label: string, href: string, isCurrent?: boolean, icon?: string | null, isIconOnly?: boolean);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
margin-block-start: var(--nol-site-footer-notice-gap);
}

/* The fine print, such as a trademark notice: its own row under the rest, across the content, in the kit's smallest
* text and the muted color, the dimmest text that keeps its contrast. */
.nol-site-footer-fine-print {
flex-basis: 100%;
margin: 0;
color: var(--nol-text-muted);
font-size: var(--nol-text-small);
line-height: var(--nol-site-footer-line-height);
}

.nol-site-footer-groups {
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -127,6 +137,42 @@
}
}

/* A link that draws its mark alone has no text to underline, so its hover is a face centred on the mark, as high and
* wide as the header's marks' face, while the mark stays at the group's edge. */
.nol-site-footer-link-alone {
position: relative;
}

.nol-site-footer-link-alone::before {
content: "";
position: absolute;
inset-block: calc(50% - var(--nol-site-download-height) / 2);
inset-inline-start: calc(0.5em - var(--nol-site-download-height) / 2);
Comment thread
rostislavrotaru marked this conversation as resolved.
Resolved
inline-size: var(--nol-site-download-height);
border-radius: var(--nol-radius-small);
}

.nol-site-footer-link-alone .nol-site-footer-link-icon {
position: relative;
}

.nol-site-footer-link-alone:is(:hover, [data-nol-state="Hover"])::before {
background-color: var(--nol-toolbar-hover);
}

/* Its keyboard focus outlines that face too, as the header's marks do, so the hover and the focus share one box. */
.nol-site-footer-link-alone:is(:focus-visible, [data-nol-state="Focus"]) {
outline: none;
}

.nol-site-footer-link-alone:is(:focus-visible, [data-nol-state="Focus"])::before {
outline: var(--nol-border-width) solid var(--nol-accent);

@media (forced-colors: active) {
outline: calc(var(--nol-border-width) * 2) solid Highlight;
}
}

.nol-site-footer-owner {
position: relative;
border-radius: var(--nol-radius-small);
Expand Down Expand Up @@ -159,7 +205,7 @@
}
}

:is(.nol-site-footer-link, .nol-site-footer-owner):is(:focus-visible, [data-nol-state="Focus"]) {
:is(.nol-site-footer-link:not(.nol-site-footer-link-alone), .nol-site-footer-owner):is(:focus-visible, [data-nol-state="Focus"]) {
outline: var(--nol-border-width) solid var(--nol-accent);
outline-offset: var(--nol-border-width);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
<p class="nol-site-footer-title" aria-hidden="true">{{ group.title }}</p>
<ul class="nol-site-footer-links">
@for (link of group.links; track link.href) {
<li class="nol-site-footer-item"><a class="nol-site-footer-link" [href]="link.href" [attr.aria-current]="link.isCurrent ? partResources.currentPage : null"
<li class="nol-site-footer-item">@if (link.isIconOnly && link.icon; as icon) {<a class="nol-site-footer-link nol-site-footer-link-alone" [href]="link.href" [attr.aria-current]="link.isCurrent ? partResources.currentPage : null"
[attr.aria-label]="link.label" [title]="link.label"><span class="nol-site-footer-link-icon" aria-hidden="true" [style.mask-image]="maskOf(icon)"></span></a
>} @else {<a class="nol-site-footer-link" [href]="link.href" [attr.aria-current]="link.isCurrent ? partResources.currentPage : null"
>@if (link.icon; as icon) {<span class="nol-site-footer-link-icon" aria-hidden="true" [style.mask-image]="maskOf(icon)"></span>}{{ link.label }}</a
></li>
>}</li>
}
</ul>
</nav>
}
</div>
@if (finePrint(); as finePrintText) {
<p class="nol-site-footer-fine-print">{{ finePrintText }}</p>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class SiteFooterComponent {
public readonly line = input<string | null>(null);
public readonly groups = input<readonly SiteLinkGroup[]>([]);
public readonly notice = input<string | null>(null);
public readonly finePrint = input<string | null>(null);
public readonly wide = input<boolean>(false);

protected readonly partResources: typeof SiteFooterResources = SiteFooterResources;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ export class SiteLink {
public readonly href: string;
public readonly isCurrent: boolean;
public readonly icon: string | null;
public readonly isIconOnly: boolean;

public constructor(label: string, href: string, isCurrent: boolean = false, icon: string | null = null) {
public constructor(label: string, href: string, isCurrent: boolean = false, icon: string | null = null, isIconOnly: boolean = false) {
this.label = label;
this.href = href;
this.isCurrent = isCurrent;
this.icon = icon;
this.isIconOnly = isIconOnly;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SiteStageService {
}

public link(link: SiteLink): SiteLink {
return new SiteLink(link.label, this.address(link.href), link.isCurrent, link.icon);
return new SiteLink(link.label, this.address(link.href), link.isCurrent, link.icon, link.isIconOnly);
}

private static stageOf(hostname: string): SiteStage {
Expand Down
Loading
Loading