diff --git a/landing/src/app/ui/call-card.ts b/landing/src/app/ui/call-card.ts index 104f4ae..571dd4e 100644 --- a/landing/src/app/ui/call-card.ts +++ b/landing/src/app/ui/call-card.ts @@ -16,6 +16,7 @@ import type { Copy } from '../core/copy'; import type { Locale } from '../core/api'; import type { PublicCall } from '../core/api.types'; import { TechnologyChip } from './technology-chip'; +import { LinkButton } from './link-button'; @Component({ selector: 'app-call-card', @@ -32,6 +33,7 @@ import { TechnologyChip } from './technology-chip'; PiTextColorDirective, PiTextWeightBoldDirective, TechnologyChip, + LinkButton, ], template: ` @if (call().path; as path) { - - - + } @else {

{{ copy().page.ctaTitle }}

{{ copy().page.ctaLead }}

- - - + `, styles: ` diff --git a/landing/src/app/ui/link-button.scss b/landing/src/app/ui/link-button.scss new file mode 100644 index 0000000..7f4f023 --- /dev/null +++ b/landing/src/app/ui/link-button.scss @@ -0,0 +1,79 @@ +:host { + display: inline-flex; +} + +// `@pi/ui` scopes its button rules to the element (`html button:not(…)` in +// `_pi-button.scss`), so an anchor cannot inherit them. Every value below is +// still the library's: these are the same `--pi-theme-button-*` custom +// properties its own rules read, so switching shell or theme moves this button +// too, and dark mode needs nothing of its own. +.link-button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.5rem; + min-width: 5.5rem; + border: none; + border-radius: var(--pi-theme-button-radius); + line-height: 100%; + text-decoration: none; + letter-spacing: var(--pi-theme-button-letter-spacing); + text-transform: var(--pi-theme-button-text-transform); + font-weight: var(--pi-theme-button-font-weight); + transition: var(--pi-theme-button-transition); + cursor: pointer; + + svg { + flex: none; + width: 0.375rem; + height: 0.5625rem; + } + + &:focus-visible { + outline: 2px solid var(--pi-color-primary); + outline-offset: 3px; + } +} + +.link-button--medium, +.link-button--large { + min-height: var(--pi-theme-button-height); + padding: var(--pi-spacing-xx-small) var(--pi-spacing-x-large); +} + +.link-button--small { + min-width: 4.5rem; + padding: var(--pi-spacing-xxxx-small) var(--pi-spacing-medium); + font-size: 0.8125rem; +} + +// Filled. The theme may inject a gradient over the flat colour, exactly as it +// does for a real button. +.link-button--fill { + color: var(--pi-color-white); + box-shadow: var(--pi-theme-button-shadow); + + &.link-button--primary { + background-color: var(--pi-color-primary); + background-image: var(--pi-theme-button-fill-primary, none); + } + + &.link-button--grey { + background-color: var(--pi-color-grey); + } +} + +// Outline. The colour is the border and the text; the surface stays clear. +.link-button--outline { + background: none; + + &.link-button--primary { + border: 1px solid var(--pi-color-primary); + color: var(--pi-color-primary); + } + + &.link-button--grey { + border: 1px solid var(--pi-color-grey-200); + color: var(--pi-color-grey); + } +} diff --git a/landing/src/app/ui/link-button.ts b/landing/src/app/ui/link-button.ts new file mode 100644 index 0000000..8964955 --- /dev/null +++ b/landing/src/app/ui/link-button.ts @@ -0,0 +1,73 @@ +import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core'; + +/** + * A link that looks like the library's action button. + * + * `pi-action-button` renders a `