B-secties: nav, hero, Over, Werkwijze, contactblok en footer volgens ontwerp B
Nieuwe tokens (brand, inv, panel, field, prog, body), Archivo als lettertype (Sora en Instrument Sans verwijderd), witte toggles op het rode kopblok, en tests voor structuur, landmarks en contrast in alle vier de thema's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
export function Footer() {
|
||||
return (
|
||||
<footer className="border-t border-line py-7 text-[0.85rem] text-muted">
|
||||
<div className="mx-auto flex max-w-[1080px] flex-wrap justify-between gap-2.5 px-6">
|
||||
<footer className="bg-inv text-[#b9b3ae]">
|
||||
<div className="mx-auto flex max-w-[1280px] flex-wrap justify-between gap-3 p-8 text-sm">
|
||||
<span>© 2026 SLP Software</span>
|
||||
<span className="font-mono">slp.Bouw(uwIdee);</span>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,10 @@ import { ModeToggle } from '../ui/ModeToggle';
|
||||
import { VariantToggle } from '../ui/VariantToggle';
|
||||
import { handleAnchorClick } from '../../utils/scrollToHash';
|
||||
|
||||
/**
|
||||
* Navigation of design B: part of the brand-red header (not sticky), white text, the CTA as a
|
||||
* white block. The mobile menu (hamburger) is kept for small screens; years are not in the menu.
|
||||
*/
|
||||
export function Nav() {
|
||||
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||
|
||||
@@ -13,23 +17,24 @@ export function Nav() {
|
||||
}
|
||||
|
||||
return (
|
||||
<nav className="sticky top-0 z-50 border-b border-line bg-bg/80 backdrop-blur-md">
|
||||
<div className="mx-auto flex h-16 max-w-[1080px] items-center justify-between px-6">
|
||||
<nav aria-label="Hoofdnavigatie" className="bg-brand text-on-brand">
|
||||
<div className="mx-auto flex min-h-[84px] max-w-[1280px] items-center justify-between gap-6 px-6 sm:px-8">
|
||||
<a
|
||||
href="#top"
|
||||
onClick={(event) => handleAnchorClick(event, '#top')}
|
||||
className="font-mono text-base font-bold tracking-wide text-text"
|
||||
className="flex items-baseline gap-2 py-2.5 no-underline"
|
||||
>
|
||||
SLP<span className="text-accent">.</span>Software
|
||||
<span className="text-2xl font-black tracking-tight [font-stretch:125%]">SLP</span>
|
||||
<span className="text-base font-normal">Software</span>
|
||||
</a>
|
||||
<ul className="flex items-center gap-3 sm:gap-7">
|
||||
<ul className="flex items-center gap-3 sm:gap-8">
|
||||
{navLinks.map((link) =>
|
||||
link.isCta ? (
|
||||
<li key={link.href} className="hidden sm:block">
|
||||
<a
|
||||
href={link.href}
|
||||
onClick={(event) => handleAnchorClick(event, link.href)}
|
||||
className="font-mono rounded-lg border border-accent-line bg-accent-soft px-4 py-2 text-sm font-medium text-text"
|
||||
className="inline-block bg-white px-[18px] py-[11px] text-[15px] font-bold text-brand no-underline hover:opacity-90"
|
||||
data-testid="nav-cta-link"
|
||||
>
|
||||
{link.label}
|
||||
@@ -40,7 +45,7 @@ export function Nav() {
|
||||
<a
|
||||
href={link.href}
|
||||
onClick={(event) => handleAnchorClick(event, link.href)}
|
||||
className="text-sm font-medium text-muted transition-colors hover:text-text"
|
||||
className="inline-block py-3 text-[15px] font-medium no-underline hover:opacity-85"
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
@@ -48,10 +53,10 @@ export function Nav() {
|
||||
),
|
||||
)}
|
||||
<li>
|
||||
<ModeToggle />
|
||||
<ModeToggle tone="onBrand" />
|
||||
</li>
|
||||
<li>
|
||||
<VariantToggle />
|
||||
<VariantToggle tone="onBrand" />
|
||||
</li>
|
||||
<li className="sm:hidden">
|
||||
<button
|
||||
@@ -61,7 +66,7 @@ export function Nav() {
|
||||
aria-expanded={isMenuOpen}
|
||||
aria-controls="mobile-nav-menu"
|
||||
data-testid="nav-mobile-toggle"
|
||||
className="flex h-8 w-8 items-center justify-center rounded-full border border-line text-text transition-colors hover:border-accent-line"
|
||||
className="flex h-11 w-11 items-center justify-center rounded-full border border-white/70 text-on-brand transition-colors hover:border-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
|
||||
>
|
||||
<span className="sr-only">{isMenuOpen ? 'Sluit menu' : 'Open menu'}</span>
|
||||
<svg
|
||||
@@ -88,7 +93,7 @@ export function Nav() {
|
||||
<ul
|
||||
id="mobile-nav-menu"
|
||||
data-testid="nav-mobile-menu"
|
||||
className="flex flex-col gap-1 border-t border-line bg-bg px-6 py-3 sm:hidden"
|
||||
className="flex flex-col gap-1 border-t border-white/30 px-6 py-3 sm:hidden"
|
||||
>
|
||||
{navLinks.map((link) => (
|
||||
<li key={link.href}>
|
||||
@@ -97,8 +102,8 @@ export function Nav() {
|
||||
onClick={(event) => handleMobileLinkClick(event, link.href)}
|
||||
className={
|
||||
link.isCta
|
||||
? 'font-mono block rounded-lg border border-accent-line bg-accent-soft px-4 py-2 text-sm font-medium text-text'
|
||||
: 'block px-1 py-2 text-sm font-medium text-muted transition-colors hover:text-text'
|
||||
? 'mt-1 block bg-white px-4 py-3 text-[15px] font-bold text-brand no-underline'
|
||||
: 'block px-1 py-3 text-[15px] font-medium no-underline hover:opacity-85'
|
||||
}
|
||||
>
|
||||
{link.label}
|
||||
|
||||
@@ -10,12 +10,14 @@ import { SentryTestButton } from '../shared/SentryTestButton';
|
||||
|
||||
export function RootLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<div className="font-sans min-h-screen bg-bg text-text">
|
||||
<div className="font-sans min-h-screen bg-bg text-[17px] leading-[1.55] text-text">
|
||||
<UmamiAnalytics />
|
||||
<VariantRenderer
|
||||
b={
|
||||
<>
|
||||
<Nav />
|
||||
<header>
|
||||
<Nav />
|
||||
</header>
|
||||
<main id="main" tabIndex={-1} className="outline-none">
|
||||
{children}
|
||||
</main>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { render, screen, within } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { RootLayout } from '../RootLayout';
|
||||
import { ThemeProvider } from '../../../theme/ThemeProvider';
|
||||
|
||||
function renderLayout() {
|
||||
return render(
|
||||
<ThemeProvider>
|
||||
<RootLayout>
|
||||
<h1>Inhoud</h1>
|
||||
</RootLayout>
|
||||
</ThemeProvider>,
|
||||
);
|
||||
}
|
||||
|
||||
describe('RootLayout landmarks (NFR-1)', () => {
|
||||
it('has a banner with the main navigation, one main region and a footer', () => {
|
||||
renderLayout();
|
||||
const banner = screen.getByRole('banner');
|
||||
expect(within(banner).getByRole('navigation', { name: 'Hoofdnavigatie' })).toBeInTheDocument();
|
||||
const main = screen.getByRole('main');
|
||||
expect(main).toHaveAttribute('id', 'main');
|
||||
expect(main).toHaveAttribute('tabindex', '-1');
|
||||
expect(within(main).getByRole('heading', { level: 1, name: 'Inhoud' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('contentinfo')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the banner before the main region and the footer after it', () => {
|
||||
renderLayout();
|
||||
const banner = screen.getByRole('banner');
|
||||
const main = screen.getByRole('main');
|
||||
const footer = screen.getByRole('contentinfo');
|
||||
expect(banner.compareDocumentPosition(main) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
||||
expect(main.compareDocumentPosition(footer) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
||||
});
|
||||
|
||||
it('shows both toggles in white on the brand header', () => {
|
||||
renderLayout();
|
||||
expect(screen.getByTestId('mode-toggle-button')).toHaveClass('text-on-brand');
|
||||
expect(screen.getByTestId('variant-toggle-button')).toHaveClass('text-on-brand');
|
||||
});
|
||||
|
||||
it('has a live region for variant announcements', () => {
|
||||
renderLayout();
|
||||
expect(screen.getByRole('status')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -1,10 +1,11 @@
|
||||
import { useTheme } from '../../theme/ThemeProvider';
|
||||
import { TONE_CLASSES, type ToggleTone } from './toggleTone';
|
||||
|
||||
/**
|
||||
* Light/dark switch (requirements FR-4, BR-U1-4, BR-U1-12). Two states; starts from the system
|
||||
* preference and remembers the visitor's choice after the first click.
|
||||
*/
|
||||
export function ModeToggle() {
|
||||
export function ModeToggle({ tone = 'default' }: { tone?: ToggleTone }) {
|
||||
const { mode, toggleMode } = useTheme();
|
||||
const isDark = mode === 'dark';
|
||||
|
||||
@@ -16,7 +17,7 @@ export function ModeToggle() {
|
||||
aria-pressed={isDark}
|
||||
title="Donkere weergave"
|
||||
data-testid="mode-toggle-button"
|
||||
className="flex h-11 w-11 items-center justify-center rounded-full border border-line text-text transition-colors hover:border-accent-line focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent sm:h-8 sm:w-8"
|
||||
className={`flex h-11 w-11 items-center justify-center rounded-full border transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 sm:h-8 sm:w-8 ${TONE_CLASSES[tone]}`}
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { useTheme } from '../../theme/ThemeProvider';
|
||||
import { TONE_CLASSES, type ToggleTone } from './toggleTone';
|
||||
|
||||
/**
|
||||
* Icon-only button next to the mode toggle that switches between B and E (FR-4, BR-U1-6,
|
||||
* BR-U1-12). The label changes with the current variant; the tooltip equals the label.
|
||||
*/
|
||||
export function VariantToggle() {
|
||||
export function VariantToggle({ tone = 'default' }: { tone?: ToggleTone }) {
|
||||
const { variant, toggleVariant, transition } = useTheme();
|
||||
const inE = variant === 'e';
|
||||
const label = inE ? 'Terug naar nu' : 'Tijdreis: bekijk de site zoals vroeger';
|
||||
@@ -17,7 +18,7 @@ export function VariantToggle() {
|
||||
title={label}
|
||||
disabled={transition.phase !== 'idle'}
|
||||
data-testid="variant-toggle-button"
|
||||
className="flex h-11 w-11 items-center justify-center rounded-full border border-line text-text transition-colors hover:border-accent-line focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-60 sm:h-8 sm:w-8"
|
||||
className={`flex h-11 w-11 items-center justify-center rounded-full border transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-60 sm:h-8 sm:w-8 ${TONE_CLASSES[tone]}`}
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Colour treatment of the round nav buttons: `default` on the page background, `onBrand` on the
|
||||
* brand-red header of design B (white outline, white text, white focus ring).
|
||||
*/
|
||||
export type ToggleTone = 'default' | 'onBrand';
|
||||
|
||||
export const TONE_CLASSES: Record<ToggleTone, string> = {
|
||||
default: 'border-line text-text hover:border-accent-line focus-visible:outline-accent',
|
||||
onBrand: 'border-white/70 text-on-brand hover:border-white focus-visible:outline-white',
|
||||
};
|
||||
@@ -0,0 +1,156 @@
|
||||
import { render, screen, within } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { Hero } from '../components/Hero';
|
||||
import { AboutSection } from '../components/AboutSection';
|
||||
import { ProcessSection } from '../components/ProcessSection';
|
||||
import { ContactSection } from '../components/ContactSection';
|
||||
import { Footer } from '../../../components/layout/Footer';
|
||||
import {
|
||||
aboutContent,
|
||||
aboutFacts,
|
||||
contactInfo,
|
||||
heroContent,
|
||||
navLinks,
|
||||
processSteps,
|
||||
} from '../data/content';
|
||||
|
||||
describe('Hero (design B)', () => {
|
||||
it('has one h1 that reads as the live headline and shows the display lines', () => {
|
||||
render(<Hero />);
|
||||
const h1 = screen.getByRole('heading', { level: 1, name: heroContent.heading });
|
||||
expect(h1).toBeInTheDocument();
|
||||
heroContent.displayHeading.forEach((line, index) => {
|
||||
expect(screen.getByTestId(`hero-line-${index}`)).toHaveTextContent(line);
|
||||
});
|
||||
});
|
||||
|
||||
it('shows the lead from the content and links to packages and contact', () => {
|
||||
render(<Hero />);
|
||||
expect(screen.getByText(heroContent.lead)).toBeInTheDocument();
|
||||
expect(screen.getByRole('link', { name: 'Bekijk pakketten' })).toHaveAttribute(
|
||||
'href',
|
||||
'#pakketten',
|
||||
);
|
||||
expect(screen.getByRole('link', { name: 'Plan een gesprek' })).toHaveAttribute(
|
||||
'href',
|
||||
'#contact',
|
||||
);
|
||||
});
|
||||
|
||||
it('shows the code line with caret (decorative) and the eyebrow in the black strip', () => {
|
||||
render(<Hero />);
|
||||
expect(screen.getByTestId('hero-caret')).toBeInTheDocument();
|
||||
expect(screen.getByText(heroContent.eyebrow)).toBeInTheDocument();
|
||||
expect(screen.getByText(heroContent.codeLine, { exact: false })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('is the target of the #top anchor', () => {
|
||||
const { container } = render(<Hero />);
|
||||
expect(container.querySelector('#top')).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('AboutSection (design B)', () => {
|
||||
it('renders heading, content paragraphs, photo with alt text and three facts', () => {
|
||||
render(<AboutSection />);
|
||||
expect(screen.getByRole('heading', { level: 2, name: /Eén ontwikkelaar/ })).toBeInTheDocument();
|
||||
aboutContent.paragraphs.forEach((p) => expect(screen.getByText(p)).toBeInTheDocument());
|
||||
expect(screen.getByAltText('Bryan Slop, oprichter van SLP Software')).toBeInTheDocument();
|
||||
expect(aboutFacts).toHaveLength(3);
|
||||
aboutFacts.forEach((fact) => {
|
||||
expect(screen.getByText(fact.title)).toBeInTheDocument();
|
||||
expect(screen.getByText(fact.text)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it('uses the #over anchor and a decorative offset block', () => {
|
||||
const { container } = render(<AboutSection />);
|
||||
expect(container.querySelector('#over')).not.toBeNull();
|
||||
expect(screen.getByTestId('about-photo-block')).toHaveAttribute('aria-hidden', 'true');
|
||||
});
|
||||
});
|
||||
|
||||
describe('ProcessSection (design B)', () => {
|
||||
it('renders an ordered list of three steps with phase, title and text', () => {
|
||||
render(<ProcessSection />);
|
||||
expect(
|
||||
screen.getByRole('heading', { level: 2, name: 'Van idee naar live in drie stappen' }),
|
||||
).toBeInTheDocument();
|
||||
const list = screen.getByRole('list');
|
||||
expect(list.tagName).toBe('OL');
|
||||
const items = within(list).getAllByRole('listitem');
|
||||
expect(items).toHaveLength(processSteps.length);
|
||||
processSteps.forEach((step) => {
|
||||
expect(screen.getByText(step.phase)).toBeInTheDocument();
|
||||
expect(screen.getByRole('heading', { level: 3, name: step.title })).toBeInTheDocument();
|
||||
expect(screen.getByText(step.description)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it('fills the progress bar 33 / 66 / 100 percent and hides the decorative numbers', () => {
|
||||
render(<ProcessSection />);
|
||||
const bars = screen.getAllByTestId('process-progress');
|
||||
expect(bars.map((bar) => parseFloat((bar as HTMLElement).style.width))).toEqual([
|
||||
expect.closeTo(33.33, 1),
|
||||
expect.closeTo(66.67, 1),
|
||||
100,
|
||||
]);
|
||||
const first = screen.getByTestId('process-step-01');
|
||||
expect(within(first).getByText('01')).toHaveAttribute('aria-hidden', 'true');
|
||||
});
|
||||
|
||||
it('uses the #werkwijze anchor', () => {
|
||||
const { container } = render(<ProcessSection />);
|
||||
expect(container.querySelector('#werkwijze')).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('ContactSection frame (design B)', () => {
|
||||
it('shows the display heading that reads as the live heading, the intro and the mail link', () => {
|
||||
render(<ContactSection />);
|
||||
expect(
|
||||
screen.getByRole('heading', { level: 2, name: contactInfo.heading }),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText(contactInfo.description)).toBeInTheDocument();
|
||||
expect(screen.getByTestId('contact-email-link')).toHaveAttribute(
|
||||
'href',
|
||||
`mailto:${contactInfo.email}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('keeps the mailto call-to-action in the panel until the form arrives (U4)', () => {
|
||||
render(<ContactSection />);
|
||||
const panel = screen.getByTestId('contact-panel');
|
||||
const button = within(panel).getByTestId('contact-mailto-button');
|
||||
expect(button.getAttribute('href')).toContain(`mailto:${contactInfo.email}?subject=`);
|
||||
});
|
||||
|
||||
it('uses the #contact anchor', () => {
|
||||
const { container } = render(<ContactSection />);
|
||||
expect(container.querySelector('#contact')).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Footer', () => {
|
||||
it('is a contentinfo landmark with the copyright and the code line', () => {
|
||||
render(<Footer />);
|
||||
expect(screen.getByRole('contentinfo')).toHaveTextContent('© 2026 SLP Software');
|
||||
expect(screen.getByText('slp.Bouw(uwIdee);')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('navigation anchors match the sections', () => {
|
||||
it('every non-CTA nav link points to an existing section id', () => {
|
||||
const { container } = render(
|
||||
<>
|
||||
<Hero />
|
||||
<AboutSection />
|
||||
<ProcessSection />
|
||||
<ContactSection />
|
||||
</>,
|
||||
);
|
||||
const ids = ['over', 'werkwijze', 'contact', 'top'];
|
||||
ids.forEach((id) => expect(container.querySelector(`#${id}`), id).not.toBeNull());
|
||||
expect(navLinks.map((l) => l.href)).toEqual(['#over', '#pakketten', '#werkwijze', '#contact']);
|
||||
});
|
||||
});
|
||||
@@ -1,46 +1,55 @@
|
||||
import { aboutContent } from '../data/content';
|
||||
import { aboutContent, aboutFacts } from '../data/content';
|
||||
|
||||
/** "Over" of design B: offset-block photo on the left, text and three facts on the right. */
|
||||
export function AboutSection() {
|
||||
return (
|
||||
<section className="py-[88px]">
|
||||
<div className="mx-auto max-w-[1080px] px-6">
|
||||
<div className="grid grid-cols-1 items-start gap-8 sm:grid-cols-[1.2fr_0.8fr] sm:grid-rows-[auto_1fr] sm:items-stretch sm:gap-12">
|
||||
<div className="order-1 mb-3 sm:col-start-1 sm:row-start-1 sm:mb-0">
|
||||
<span
|
||||
id="over"
|
||||
className="font-mono block scroll-mt-16 text-sm uppercase tracking-wider text-accent"
|
||||
>
|
||||
// over
|
||||
</span>
|
||||
<h2 className="font-display mt-3.5 text-3xl font-bold sm:text-4xl">
|
||||
Eén ontwikkelaar, korte lijnen
|
||||
</h2>
|
||||
</div>
|
||||
<div className="order-2 flex items-center justify-center sm:order-3 sm:col-start-2 sm:row-start-1 sm:row-span-2">
|
||||
<picture>
|
||||
<source
|
||||
type="image/webp"
|
||||
srcSet="/bryan-slop-400.webp 400w, /bryan-slop-800.webp 800w"
|
||||
sizes="(min-width: 640px) 224px, 160px"
|
||||
/>
|
||||
<img
|
||||
src="/bryan-slop-800.jpg"
|
||||
srcSet="/bryan-slop-400.jpg 400w, /bryan-slop-800.jpg 800w"
|
||||
sizes="(min-width: 640px) 224px, 160px"
|
||||
alt="Bryan Slop, oprichter van SLP Software"
|
||||
width={224}
|
||||
height={224}
|
||||
className="h-40 w-40 rounded-full border-2 border-accent-line object-cover shadow-lg sm:h-56 sm:w-56"
|
||||
/>
|
||||
</picture>
|
||||
</div>
|
||||
<div className="order-3 sm:order-2 sm:col-start-1 sm:row-start-2">
|
||||
{aboutContent.paragraphs.map((paragraph) => (
|
||||
<p key={paragraph} className="mb-4 text-muted">
|
||||
{paragraph}
|
||||
</p>
|
||||
<section id="over" aria-labelledby="over-heading" className="bg-bg">
|
||||
<div className="mx-auto grid max-w-[1280px] grid-cols-1 items-center gap-x-[104px] gap-y-[72px] px-6 py-20 sm:px-8 md:grid-cols-2 md:py-[136px]">
|
||||
<div className="relative mb-7 mr-7 max-w-[480px]">
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="absolute -bottom-7 -right-7 h-[55%] w-[55%] bg-brand"
|
||||
data-testid="about-photo-block"
|
||||
/>
|
||||
<picture>
|
||||
<source
|
||||
type="image/webp"
|
||||
srcSet="/bryan-slop-400.webp 400w, /bryan-slop-800.webp 800w"
|
||||
sizes="(min-width: 768px) 480px, 90vw"
|
||||
/>
|
||||
<img
|
||||
src="/bryan-slop-800.jpg"
|
||||
srcSet="/bryan-slop-400.jpg 400w, /bryan-slop-800.jpg 800w"
|
||||
sizes="(min-width: 768px) 480px, 90vw"
|
||||
alt="Bryan Slop, oprichter van SLP Software"
|
||||
width={480}
|
||||
height={640}
|
||||
className="relative block aspect-[3/4] w-full object-cover object-[50%_30%]"
|
||||
/>
|
||||
</picture>
|
||||
</div>
|
||||
<div>
|
||||
<h2
|
||||
id="over-heading"
|
||||
className="mb-9 text-[clamp(40px,5.4vw,80px)] font-extrabold leading-[0.95] tracking-[-0.03em] [font-stretch:112%]"
|
||||
>
|
||||
Eén ontwikkelaar, korte lijnen
|
||||
</h2>
|
||||
{aboutContent.paragraphs.map((paragraph) => (
|
||||
<p key={paragraph} className="mb-[18px] max-w-[52ch] text-body">
|
||||
{paragraph}
|
||||
</p>
|
||||
))}
|
||||
<dl className="mt-14 grid grid-cols-1 gap-7 sm:grid-cols-3 sm:gap-x-8">
|
||||
{aboutFacts.map((fact) => (
|
||||
<div key={fact.title} className="border-t-[3px] border-text pt-3.5">
|
||||
<dt className="text-[22px] font-extrabold leading-[1.15] [font-stretch:112%]">
|
||||
{fact.title}
|
||||
</dt>
|
||||
<dd className="mt-1.5 text-[15px] text-muted">{fact.text}</dd>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,34 +1,56 @@
|
||||
import { contactInfo } from '../data/content';
|
||||
|
||||
/**
|
||||
* Contact block of design B: brand-red section with the display heading, intro, mail link and a
|
||||
* panel on the right. Until the contact form (unit U4) the panel holds the mailto call-to-action.
|
||||
*/
|
||||
export function ContactSection() {
|
||||
const mailtoHref = `mailto:${contactInfo.email}?subject=${encodeURIComponent(contactInfo.mailSubject)}`;
|
||||
|
||||
return (
|
||||
<section className="pb-[110px]">
|
||||
<div className="mx-auto max-w-[1080px] px-6">
|
||||
<div className="rounded-[20px] border border-accent-line bg-gradient-to-br from-surface-2 to-surface px-10 py-14 text-center">
|
||||
<span
|
||||
id="contact"
|
||||
className="font-mono block scroll-mt-16 text-sm uppercase tracking-wider text-accent"
|
||||
>
|
||||
// contact
|
||||
</span>
|
||||
<h2 className="font-display mt-3.5 text-3xl font-bold sm:text-4xl">
|
||||
{contactInfo.heading}
|
||||
</h2>
|
||||
<p className="mx-auto mb-8 mt-3.5 max-w-[46ch] text-muted">{contactInfo.description}</p>
|
||||
<a
|
||||
href={mailtoHref}
|
||||
className="rounded-lg bg-accent px-6 py-3.5 text-[0.98rem] font-semibold text-[var(--color-accent-contrast)] transition-colors hover:bg-[var(--color-accent-hover)]"
|
||||
>
|
||||
Stuur een bericht
|
||||
</a>
|
||||
<span className="font-mono mt-5 block text-[0.9rem] text-muted">
|
||||
of mail direct naar{' '}
|
||||
<a href={`mailto:${contactInfo.email}`} className="text-accent underline-offset-2 hover:underline">
|
||||
<section id="contact" aria-labelledby="contact-heading" className="bg-brand text-on-brand">
|
||||
<div className="mx-auto max-w-[1280px] px-6 pb-24 pt-20 sm:px-8 md:pb-[152px] md:pt-36">
|
||||
<h2
|
||||
id="contact-heading"
|
||||
className="text-[clamp(56px,10.5vw,168px)] font-extrabold leading-[0.88] tracking-[-0.03em] [font-stretch:125%]"
|
||||
aria-label={contactInfo.heading}
|
||||
>
|
||||
{contactInfo.displayHeading.map((line) => (
|
||||
<span key={line} className="block" aria-hidden="true">
|
||||
{line}
|
||||
</span>
|
||||
))}
|
||||
</h2>
|
||||
<div className="mt-12 flex flex-wrap items-end justify-between gap-x-16 gap-y-10 md:mt-[72px]">
|
||||
<div className="flex-[1_1_320px] self-start">
|
||||
<p className="mb-10 max-w-[40ch] text-[19px]">{contactInfo.description}</p>
|
||||
<p className="mb-2 text-[15px] font-semibold">Liever direct mailen?</p>
|
||||
<a
|
||||
href={`mailto:${contactInfo.email}`}
|
||||
className="break-words text-[clamp(24px,2.6vw,36px)] font-bold tracking-[-0.02em] underline decoration-[3px] underline-offset-8 [font-stretch:112%]"
|
||||
data-testid="contact-email-link"
|
||||
>
|
||||
{contactInfo.email}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
className="min-w-0 flex-[1.4_1_520px] bg-panel p-[clamp(24px,4vw,48px)] text-text"
|
||||
data-testid="contact-panel"
|
||||
>
|
||||
<p className="mb-3 text-[clamp(28px,3vw,40px)] font-extrabold leading-none tracking-[-0.02em] [font-stretch:112%]">
|
||||
Vertel wat je voor ogen hebt
|
||||
</p>
|
||||
<p className="mb-7 max-w-[44ch] text-body">
|
||||
Stuur een bericht met je idee of vraag. Je krijgt binnen één werkdag reactie.
|
||||
</p>
|
||||
<a
|
||||
href={mailtoHref}
|
||||
className="inline-block bg-brand px-6 py-[18px] text-[17px] font-bold text-on-brand no-underline hover:opacity-90"
|
||||
data-testid="contact-mailto-button"
|
||||
>
|
||||
Stuur een bericht
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,41 +1,59 @@
|
||||
import { heroContent } from '../data/content';
|
||||
import { handleAnchorClick } from '../../../utils/scrollToHash';
|
||||
|
||||
/**
|
||||
* Hero of design B: display headline on the brand-red block, lead + two buttons, and the black
|
||||
* code strip with the blinking caret. The nav sits directly above in the same colour.
|
||||
*/
|
||||
export function Hero() {
|
||||
return (
|
||||
<header id="top" className="relative overflow-hidden pb-[88px] pt-24">
|
||||
<div className="mx-auto max-w-[1080px] px-6">
|
||||
<span className="font-mono mb-5 block text-sm uppercase tracking-wider text-accent">
|
||||
{heroContent.eyebrow}
|
||||
</span>
|
||||
<h1 className="font-display mb-6 max-w-[15ch] text-4xl font-extrabold leading-tight tracking-tight sm:text-5xl">
|
||||
{heroContent.heading}
|
||||
</h1>
|
||||
<p className="mb-9 max-w-[52ch] text-lg text-muted">{heroContent.lead}</p>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="font-mono mb-10 inline-flex max-w-full items-center gap-2 overflow-x-auto whitespace-nowrap rounded border border-line bg-surface px-6 py-4 shadow-lg"
|
||||
<section id="top" aria-labelledby="hero-heading" className="bg-brand text-on-brand">
|
||||
<div className="mx-auto max-w-[1280px] px-6 pb-16 pt-10 sm:px-8 sm:pb-24 sm:pt-16">
|
||||
<h1
|
||||
id="hero-heading"
|
||||
className="text-[clamp(56px,10.5vw,168px)] font-extrabold leading-[0.88] tracking-[-0.03em] [font-stretch:125%]"
|
||||
aria-label={heroContent.heading}
|
||||
>
|
||||
<span>{heroContent.codeLine}</span>
|
||||
<span className="caret" data-testid="hero-caret" />
|
||||
</div>
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:flex-wrap">
|
||||
<a
|
||||
href="#pakketten"
|
||||
onClick={(event) => handleAnchorClick(event, '#pakketten')}
|
||||
className="rounded-lg bg-accent px-6 py-3.5 text-center text-[0.98rem] font-semibold text-[var(--color-accent-contrast)] transition-transform hover:bg-[var(--color-accent-hover)] active:scale-[0.98] sm:text-left"
|
||||
>
|
||||
Bekijk pakketten
|
||||
</a>
|
||||
<a
|
||||
href="#contact"
|
||||
onClick={(event) => handleAnchorClick(event, '#contact')}
|
||||
className="rounded-lg border border-line px-6 py-3.5 text-center text-[0.98rem] font-semibold text-text transition-colors hover:border-accent-line sm:text-left"
|
||||
>
|
||||
Plan een gesprek
|
||||
</a>
|
||||
{heroContent.displayHeading.map((line, index) => (
|
||||
<span
|
||||
key={line}
|
||||
className="block"
|
||||
aria-hidden="true"
|
||||
data-testid={`hero-line-${index}`}
|
||||
>
|
||||
{line}
|
||||
</span>
|
||||
))}
|
||||
</h1>
|
||||
<div className="mt-12 flex flex-wrap items-end justify-between gap-10 sm:mt-[72px] lg:gap-x-16">
|
||||
<p className="max-w-[48ch] text-[19px] leading-[1.55]">{heroContent.lead}</p>
|
||||
<div className="flex flex-wrap gap-3">
|
||||
<a
|
||||
href="#pakketten"
|
||||
onClick={(event) => handleAnchorClick(event, '#pakketten')}
|
||||
className="bg-white px-[26px] py-[17px] text-base font-bold text-[#0e0d0d] no-underline hover:opacity-90"
|
||||
>
|
||||
Bekijk pakketten
|
||||
</a>
|
||||
<a
|
||||
href="#contact"
|
||||
onClick={(event) => handleAnchorClick(event, '#contact')}
|
||||
className="border-2 border-white px-6 py-[15px] text-base font-bold text-white no-underline hover:opacity-90"
|
||||
>
|
||||
Plan een gesprek
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div className="bg-inv">
|
||||
<div className="font-mono mx-auto flex max-w-[1280px] flex-wrap items-center justify-between gap-x-8 gap-y-2 px-6 py-[22px] text-base sm:px-8">
|
||||
<span className="text-white" aria-hidden="true">
|
||||
<span className="text-[#a8a29c]">~/slp $</span> {heroContent.codeLine}
|
||||
<span className="caret ml-1.5 !bg-white" data-testid="hero-caret" />
|
||||
</span>
|
||||
<span className="text-sm text-[#a8a29c]">{heroContent.eyebrow}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
import { processSteps } from '../data/content';
|
||||
import { ProcessStep } from './ProcessStep';
|
||||
|
||||
/** "Werkwijze" of design B: black section with three steps, progress bars and outlined numbers. */
|
||||
export function ProcessSection() {
|
||||
return (
|
||||
<section className="py-[88px]">
|
||||
<div className="mx-auto max-w-[1080px] px-6">
|
||||
<div className="mb-[52px]">
|
||||
<span
|
||||
id="werkwijze"
|
||||
className="font-mono block scroll-mt-16 text-sm uppercase tracking-wider text-accent"
|
||||
>
|
||||
// werkwijze
|
||||
</span>
|
||||
<h2 className="font-display mt-3.5 text-3xl font-bold sm:text-4xl">
|
||||
Van idee naar live in drie stappen
|
||||
</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-[22px] sm:grid-cols-3">
|
||||
{processSteps.map((step) => (
|
||||
<ProcessStep key={step.label} step={step} />
|
||||
<section id="werkwijze" aria-labelledby="werkwijze-heading" className="bg-inv text-white">
|
||||
<div className="mx-auto max-w-[1280px] px-6 pb-24 pt-20 sm:px-8 md:pb-[136px] md:pt-32">
|
||||
<h2
|
||||
id="werkwijze-heading"
|
||||
className="mb-16 max-w-[14ch] text-[clamp(40px,5.4vw,80px)] font-extrabold leading-[0.95] tracking-[-0.03em] [font-stretch:112%] md:mb-[88px]"
|
||||
>
|
||||
Van idee naar live in drie stappen
|
||||
</h2>
|
||||
<ol className="grid grid-cols-1 gap-x-10 gap-y-16 md:grid-cols-3">
|
||||
{processSteps.map((step, index) => (
|
||||
<ProcessStep key={step.label} step={step} index={index} total={processSteps.length} />
|
||||
))}
|
||||
</div>
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
|
||||
@@ -1,11 +1,32 @@
|
||||
import type { ProcessStepData } from '../data/content';
|
||||
|
||||
export function ProcessStep({ step }: { step: ProcessStepData }) {
|
||||
interface ProcessStepProps {
|
||||
step: ProcessStepData;
|
||||
/** 0-based position and total, used for the number and the progress bar (33 / 66 / 100 %). */
|
||||
index: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function ProcessStep({ step, index, total }: ProcessStepProps) {
|
||||
const number = String(index + 1).padStart(2, '0');
|
||||
const progress = `${((index + 1) / total) * 100}%`;
|
||||
|
||||
return (
|
||||
<div className="border-l-2 border-line py-1 pl-6 transition-colors hover:border-accent">
|
||||
<span className="font-mono mb-2.5 block text-[0.78rem] text-accent">{step.label}</span>
|
||||
<h3 className="mb-2 text-[1.08rem]">{step.title}</h3>
|
||||
<p className="text-[0.93rem] text-muted">{step.description}</p>
|
||||
</div>
|
||||
<li data-testid={`process-step-${number}`}>
|
||||
<div aria-hidden="true" className="mb-8 h-1 bg-[#34302e]">
|
||||
<div className="h-1 bg-prog" style={{ width: progress }} data-testid="process-progress" />
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="mb-8 text-[120px] font-black leading-[0.9] text-transparent [-webkit-text-stroke:1.5px_#ffffff] [font-stretch:125%]"
|
||||
>
|
||||
{number}
|
||||
</div>
|
||||
<p className="mb-2 text-sm font-semibold text-[#b9b3ae]">{step.phase}</p>
|
||||
<h3 className="mb-3 text-[26px] font-extrabold leading-[1.1] [font-stretch:112%]">
|
||||
{step.title}
|
||||
</h3>
|
||||
<p className="max-w-[36ch] text-base text-[#cfcac5]">{step.description}</p>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ export interface NavLink {
|
||||
export interface HeroContent {
|
||||
eyebrow: string;
|
||||
heading: string;
|
||||
/** Display headline of design B, one entry per line ("Websites," / "apps" / "& meer."). */
|
||||
displayHeading: string[];
|
||||
lead: string;
|
||||
codeLine: string;
|
||||
}
|
||||
@@ -39,16 +41,25 @@ export interface PackageCardData {
|
||||
|
||||
export interface ProcessStepData {
|
||||
label: string;
|
||||
/** Short phase name shown above the title in design B ("Intake", "Bouwen", "Live"). */
|
||||
phase: string;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface AboutFact {
|
||||
title: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface AboutContent {
|
||||
paragraphs: string[];
|
||||
}
|
||||
|
||||
export interface ContactInfo {
|
||||
heading: string;
|
||||
/** Display headline of design B, one entry per line ("Klaar om" / "te bouwen?"). */
|
||||
displayHeading: string[];
|
||||
description: string;
|
||||
email: string;
|
||||
mailSubject: string;
|
||||
@@ -64,6 +75,7 @@ export const navLinks: NavLink[] = [
|
||||
export const heroContent: HeroContent = {
|
||||
eyebrow: 'Web & .NET development',
|
||||
heading: 'SLP software: websites, apps & meer',
|
||||
displayHeading: ['Websites,', 'apps', '& meer.'],
|
||||
lead: 'Bij SLP Software kun je terecht voor maatwerk oplossingen. Of het nou gaat om een website, cms of app: wij bouwen het allemaal. Voor ondernemers die geen verrassingen willen — niet in de code, niet op de factuur.',
|
||||
codeLine: 'var website = slp.Bouw(uwIdee);',
|
||||
};
|
||||
@@ -120,18 +132,21 @@ export const packages: PackageCardData[] = [
|
||||
export const processSteps: ProcessStepData[] = [
|
||||
{
|
||||
label: 'stap 01 — intake',
|
||||
phase: 'Intake',
|
||||
title: 'Kennismaken',
|
||||
description:
|
||||
'We bespreken je idee, doelgroep en wensen. Je krijgt direct een eerlijk advies over welk pakket past bij jouw doel.',
|
||||
},
|
||||
{
|
||||
label: 'stap 02 — bouwen',
|
||||
phase: 'Bouwen',
|
||||
title: 'Ontwerpen & ontwikkelen',
|
||||
description:
|
||||
'Ik bouw je site of applicatie en houd je onderweg op de hoogte, zodat er geen verrassingen zijn bij de oplevering.',
|
||||
},
|
||||
{
|
||||
label: 'stap 03 — live',
|
||||
phase: 'Live',
|
||||
title: 'Opleveren',
|
||||
description:
|
||||
'Je site gaat live en je krijgt uitleg over hoe alles werkt. Later uitbreiden? Dat kan altijd.',
|
||||
@@ -145,8 +160,15 @@ export const aboutContent: AboutContent = {
|
||||
],
|
||||
};
|
||||
|
||||
export const aboutFacts: AboutFact[] = [
|
||||
{ title: 'Direct contact', text: 'met de ontwikkelaar zelf' },
|
||||
{ title: 'Eén werkdag', text: 'tot je een reactie hebt' },
|
||||
{ title: 'Vaste prijs', text: 'per pakket, vooraf bekend' },
|
||||
];
|
||||
|
||||
export const contactInfo: ContactInfo = {
|
||||
heading: 'Klaar om te bouwen?',
|
||||
displayHeading: ['Klaar om', 'te bouwen?'],
|
||||
description:
|
||||
'Vertel kort wat je voor ogen hebt. Je krijgt binnen één werkdag reactie met een eerlijk advies — vrijblijvend.',
|
||||
email: 'info@slpsoftware.nl',
|
||||
|
||||
+2
-11
@@ -3,19 +3,10 @@
|
||||
* Google Fonts CDN, avoiding an external dependency and the SRI concerns that would
|
||||
* otherwise apply to a CDN-loaded stylesheet).
|
||||
*
|
||||
* Weights match the reference designs' Google Fonts request:
|
||||
* Sora: 400;600;700;800 — Instrument Sans: 400;500;600 — JetBrains Mono: 400;500;700
|
||||
* Archivo (variable: weight 100-900, width 62-125%) is the face of design B.
|
||||
* JetBrains Mono: 400;500;700 (code line, mono labels).
|
||||
*/
|
||||
// Archivo (variable: weight 100-900, width 62-125%) is the display/body face of design B.
|
||||
// The three families below are removed when the B sections are restyled (unit U2).
|
||||
import '@fontsource-variable/archivo/wdth.css';
|
||||
import '@fontsource/sora/400.css';
|
||||
import '@fontsource/sora/600.css';
|
||||
import '@fontsource/sora/700.css';
|
||||
import '@fontsource/sora/800.css';
|
||||
import '@fontsource/instrument-sans/400.css';
|
||||
import '@fontsource/instrument-sans/500.css';
|
||||
import '@fontsource/instrument-sans/600.css';
|
||||
import '@fontsource/jetbrains-mono/400.css';
|
||||
import '@fontsource/jetbrains-mono/500.css';
|
||||
import '@fontsource/jetbrains-mono/700.css';
|
||||
|
||||
@@ -24,6 +24,13 @@ html[data-variant='b'][data-mode='light'] {
|
||||
--color-accent-line: rgba(122, 20, 20, 0.35);
|
||||
--color-accent-hover: #911a1a;
|
||||
--color-accent-contrast: #ffffff;
|
||||
--color-brand: #7a1414;
|
||||
--color-on-brand: #ffffff;
|
||||
--color-body: #3f3b38;
|
||||
--color-inv: #0e0d0d;
|
||||
--color-panel: #ffffff;
|
||||
--color-field: #f1efec;
|
||||
--color-prog: #7a1414;
|
||||
}
|
||||
|
||||
html[data-variant='b'][data-mode='dark'] {
|
||||
@@ -39,6 +46,13 @@ html[data-variant='b'][data-mode='dark'] {
|
||||
--color-accent-line: rgba(229, 82, 74, 0.4);
|
||||
--color-accent-hover: #ec6a62;
|
||||
--color-accent-contrast: #0f0e0e;
|
||||
--color-brand: #7a1414;
|
||||
--color-on-brand: #ffffff;
|
||||
--color-body: #d2cdc8;
|
||||
--color-inv: #050404;
|
||||
--color-panel: #1c1918;
|
||||
--color-field: #0f0e0e;
|
||||
--color-prog: #e5524a;
|
||||
}
|
||||
|
||||
html[data-variant='e'][data-mode='light'] {
|
||||
@@ -54,6 +68,13 @@ html[data-variant='e'][data-mode='light'] {
|
||||
--color-accent-line: rgba(172, 0, 0, 0.35);
|
||||
--color-accent-hover: #c40000;
|
||||
--color-accent-contrast: #ffffff;
|
||||
--color-brand: #ac0000;
|
||||
--color-on-brand: #ffffff;
|
||||
--color-body: #333333;
|
||||
--color-inv: #111111;
|
||||
--color-panel: #ffffff;
|
||||
--color-field: #f3f3f3;
|
||||
--color-prog: #ac0000;
|
||||
}
|
||||
|
||||
html[data-variant='e'][data-mode='dark'] {
|
||||
@@ -69,6 +90,13 @@ html[data-variant='e'][data-mode='dark'] {
|
||||
--color-accent-line: rgba(255, 107, 94, 0.4);
|
||||
--color-accent-hover: #ff8277;
|
||||
--color-accent-contrast: #1b1b1d;
|
||||
--color-brand: #ac0000;
|
||||
--color-on-brand: #ffffff;
|
||||
--color-body: #cfcfd3;
|
||||
--color-inv: #0e0e10;
|
||||
--color-panel: #232326;
|
||||
--color-field: #1b1b1d;
|
||||
--color-prog: #ff6b5e;
|
||||
}
|
||||
|
||||
html {
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import css from '../../index.css?raw';
|
||||
|
||||
/** WCAG relative luminance / contrast ratio for #rrggbb values. */
|
||||
function luminance(hex: string): number {
|
||||
const channels = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16) / 255);
|
||||
const [r, g, b] = channels.map((c) => (c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));
|
||||
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||
}
|
||||
|
||||
function contrast(a: string, b: string): number {
|
||||
const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x);
|
||||
return (hi + 0.05) / (lo + 0.05);
|
||||
}
|
||||
|
||||
/** Token values of one variant x mode block of src/index.css. */
|
||||
function tokens(variant: 'b' | 'e', mode: 'light' | 'dark'): Record<string, string> {
|
||||
const selector = `html[data-variant='${variant}'][data-mode='${mode}'] {`;
|
||||
const start = css.indexOf(selector);
|
||||
expect(start, `block for ${variant}/${mode}`).toBeGreaterThan(-1);
|
||||
const block = css.slice(start, css.indexOf('}', start));
|
||||
const result: Record<string, string> = {};
|
||||
for (const match of block.matchAll(/--color-([a-z0-9-]+):\s*(#[0-9a-fA-F]{6})\s*;/g)) {
|
||||
result[match[1]] = match[2];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const SETS = [
|
||||
['b', 'light'],
|
||||
['b', 'dark'],
|
||||
['e', 'light'],
|
||||
['e', 'dark'],
|
||||
] as const;
|
||||
|
||||
describe('token contrast (NFR-1, WCAG AA)', () => {
|
||||
describe.each(SETS)('variant %s, mode %s', (variant, mode) => {
|
||||
const t = tokens(variant, mode);
|
||||
|
||||
it('defines every token the design uses', () => {
|
||||
for (const name of [
|
||||
'bg',
|
||||
'surface',
|
||||
'surface-2',
|
||||
'line',
|
||||
'text',
|
||||
'muted',
|
||||
'accent',
|
||||
'accent-contrast',
|
||||
'brand',
|
||||
'on-brand',
|
||||
'body',
|
||||
'inv',
|
||||
'panel',
|
||||
'field',
|
||||
'prog',
|
||||
]) {
|
||||
expect(t[name], name).toBeDefined();
|
||||
}
|
||||
});
|
||||
|
||||
it.each([
|
||||
['text', 'bg'],
|
||||
['text', 'surface'],
|
||||
['body', 'bg'],
|
||||
['muted', 'bg'],
|
||||
['muted', 'surface'],
|
||||
['accent', 'bg'],
|
||||
['accent-contrast', 'accent'],
|
||||
['on-brand', 'brand'],
|
||||
['text', 'panel'],
|
||||
['muted', 'panel'],
|
||||
['text', 'field'],
|
||||
])('%s on %s has at least 4.5:1', (fg, bg) => {
|
||||
expect(contrast(t[fg], t[bg]), `${fg} ${t[fg]} on ${bg} ${t[bg]}`).toBeGreaterThanOrEqual(
|
||||
4.5,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user