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
26 changes: 13 additions & 13 deletions openspec/specs/catalogue-site/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,32 +330,32 @@ Cards, buttons, line chips and tag chips SHALL have the identity's ink frame: an
- **WHEN** a line chip button is focused with the keyboard in either theme
- **THEN** it shows the same focus outline as before this change, besides its frame

### Requirement: Brand mark
The favicon SHALL be the design system's `ledgerMark` at size 32 in a 32 × 32 SVG. The header SHALL show the mark before the site title as decorative images (`alt=""`) loaded from the site's own folder: `favicon.svg` in the light theme, and `brand-mark-dark.svg`, the `ledgerMark` drawn for the dark surface, in the dark theme. The site's templates SHALL write `img` elements only for the header marks, the footer symbols, the home banner and the home link icons.
### Requirement: Family mark
The favicon SHALL be the design system's family mark for stackledger, built from `scripts/favicon.json`, and the header SHALL show that same file before the site title as one decorative image (`alt=""`) in both themes. The site's templates SHALL write `img` elements only for the header mark, the footer symbols, the home banner and the home link icons.

#### Scenario: Favicon is the mark
#### Scenario: Favicon is the family mark
- **WHEN** `site/public/favicon.svg` is read
- **THEN** it is a 32 × 32 SVG whose shapes equal those of `ledgerMark({ x: 0, y: 0, size: 32 })`
- **THEN** its shapes equal those of `coverTree` for `scripts/favicon.json`, which `validateCoverSpec` accepts with no problem

#### Scenario: Favicon is the page mark
#### Scenario: Favicon is the cream tile with the blue s and the orange moon
- **WHEN** `site/public/favicon.svg` is read
- **THEN** its first shape is a `rect` at (0.625, 0.625), 30.75 × 30.75, `rx` 6.6, filled `#FFFFFF` and stroked `#121212` with width 1.25, and it has no other `rect`
- **THEN** its tile `rect` is filled `#F6F3EC`, its `path` is stroked `#3B5BDB`, its `circle` is filled `#E04E17`, and it holds no `style` element and no `prefers-color-scheme` rule

#### Scenario: Dark mark is the dark ledgerMark
- **WHEN** `site/public/brand-mark-dark.svg` is read
- **THEN** it is a 32 × 32 SVG whose shapes equal those of `ledgerMark({ x: 0, y: 0, size: 32, surface: "dark" })`, whose page `rect` is stroked `#ADA79D`, with no other `rect`
#### Scenario: The ledger page stays in the banner
- **WHEN** the files of `site/public/` are listed
- **THEN** there is no `brand-mark-dark.svg`, and `ledgerMark` remains in `home-banner.svg`

#### Scenario: Header mark with a custom title
- **WHEN** `spec.site.title` is `Northwind software` and any page is opened
- **THEN** the header link to the home holds an `img` with `alt=""` and a relative `src` ending in `favicon.svg`, then one ending in `brand-mark-dark.svg`, followed by `Northwind software`
- **THEN** the header link to the home holds one `img` with `alt=""` and a relative `src` ending in `favicon.svg`, followed by `Northwind software`

#### Scenario: Mark follows the theme
#### Scenario: Mark in both themes
- **WHEN** any page is shown in the light theme, then in the dark theme
- **THEN** only `favicon.svg` is visible in the header in light and only `brand-mark-dark.svg` in dark, inline before the title
- **THEN** `favicon.svg` is the only image visible in the header in both, inline before the title

#### Scenario: No other images
- **WHEN** both sites are built from the example with `spec.site.home.links` holding a link with an icon
- **THEN** every `img` element of every page is a header mark, a footer symbol (`symbol-light.svg` or `symbol-dark.svg`), the home banner or a home link icon
- **THEN** every `img` element of every page is the header mark, a footer symbol (`symbol-light.svg` or `symbol-dark.svg`), the home banner or a home link icon

### Requirement: Strip interchange
On a journey strip, a stop that is also on another drawn line SHALL be a vertical capsule drawn by `stationMarker` with the interchange radius (`map.stopRadius` plus `map.interchangeExtra`), from 4 units above to 4 units below the line, so the terminal badge above it and the label below it stay clear of its outline.
Expand Down
2 changes: 1 addition & 1 deletion openspec/specs/skills-site/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Text from skill files and map files SHALL be shown only as text, escaped by the

#### Scenario: Description with HTML
- **WHEN** a description holds `<img src=x onerror=alert(1)>`
- **THEN** the pages show it as text and no page has an `img` element other than the site's own images ("Brand mark")
- **THEN** the pages show it as text and no page has an `img` element other than the site's own images ("Family mark")

#### Scenario: Hostile script text
- **WHEN** a description and a rule text hold `</script><script>alert(1)</script>`
Expand Down
2 changes: 1 addition & 1 deletion test/browser/site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const frameOf = (page: Page, selector: string) => page.locator(selector).first()
return { width: style.borderTopWidth, style: style.borderTopStyle, color: style.borderTopColor, shadow: style.boxShadow };
});

// catalogue-site "Home banner art", "Home links" and "Brand mark": images that follow the width and the theme.
// catalogue-site "Home banner art", "Home links" and "Family mark": images that follow the width and the theme.
test('Banner keeps its ratio', async ({ page }) => {
for (const width of [375, 1440]) {
await page.setViewportSize({ width, height: 900 });
Expand Down
2 changes: 1 addition & 1 deletion test/integration/site-skills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ test.concurrent('Relative skills folder', async () => {
expect(html(target, 'full', 'skills/writer')).toContain('<code>skills/writer/SKILL.md</code>');
for (const file of files(target)) expect(readFileSync(join(target, file), 'utf8'), file).not.toContain('northwind-kit');
}, 180_000);
/** The page without the site's own images (catalogue-site "Brand mark", "Parent brand endorsement"): class, empty alt, the only allowed attributes and a site art src. */
/** The page without the site's own images (catalogue-site "Family mark", "Parent brand endorsement"): class, empty alt, the only allowed attributes and a site art src. */
const SITE_IMAGE = /<img class="(?:brand-mark|symbol-mark themed-(?:light|dark)|home-banner-art|link-icon themed-(?:light|dark))" src="(?:\.\.\/)*(?:favicon\.svg|symbol-(?:light|dark)\.svg|home-banner\.svg|link-icons\/(?:github|website|linkedin|email|stackledger)-(?:light|dark)\.svg)" alt="" width="\d+" height="\d+">/g;
const withoutSiteImages = (html: string) => html.replace(SITE_IMAGE, '');

Expand Down
4 changes: 2 additions & 2 deletions test/integration/site.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ test('No SVG of the sites holds a style', () => {
}
});

// catalogue-site "Brand mark": the templates write img elements only for these files.
// catalogue-site "Family mark": the templates write img elements only for these files.
test('No other images', () => {
const allowed = /^(?:\.\.\/)*(?:favicon\.svg|symbol-light\.svg|symbol-dark\.svg|home-banner\.svg|link-icons\/[a-z]+-(?:light|dark)\.svg)$/;
for (const site of [iconed.full, iconed.staff]) {
Expand Down Expand Up @@ -290,7 +290,7 @@ test("Accent stays stackledger's", () => {
}
});

// catalogue-site "Brand mark": the header shows the mark before a custom title.
// catalogue-site "Family mark": the header shows the mark before a custom title.
test('Header mark with a custom title', () => {
for (const site of [main.full, main.staff]) {
for (const page of ['index.html', 'map/index.html', 'software/editor/index.html']) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/site-brand.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** The site's static art is the design system's pieces (catalogue-site: Brand mark, Home banner art, Home links,
/** The site's static art is the design system's pieces (catalogue-site: Family mark, Home banner art, Home links,
* Parent brand endorsement; catalogue: Home settings). Files are written by scripts/site-art.mjs. Run npm test. */
import { test, expect } from 'vitest';
import { existsSync, readFileSync, readdirSync } from 'node:fs';
Expand Down
Loading