@logomarks/brand-kit 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to `@logomarks/brand-kit` are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.0] — 2026-11-15
9
+
10
+ ### Added
11
+
12
+ - `faviconSet(brand, { adaptive: true })`: `favicon.svg` as the mark alone, transparent, in the palette's ink for the browser's light mode and its paper for dark mode, cropped close for a tab (`adaptiveIcon`). The `.ico` and the PNGs are unchanged. From the Logomarks studio's favicon kit, which had its own.
13
+ - `lightDarkSet(brand, { rasterize })`: the mark for light and dark grounds, as SVG (ink, paper, and one that follows the reader's mode), transparent PNGs at 512, 1024 and 2048 (`LIGHT_DARK_PNG_SIZES`), and a preview on each ground. From the studio's light/dark pack.
14
+
8
15
  ## [0.5.3] — 2026-11-12
9
16
 
10
17
  ### Fixed
package/docs/api.md CHANGED
@@ -78,7 +78,8 @@ One of the styles on a canvas of your own (a business card, a poster, a sleeve,
78
78
  | Export | |
79
79
  |---|---|
80
80
  | `resolveBrand(input)` | The brand resolved: mark, palette, font, the name as outlines (`nameSet`, `nameType`), the lockups' tagline (`taglineSet`, `taglineType`, or null), `grounds`, `lockup(layout, colors)`. |
81
- | `faviconSet(brand, { small, rasterize })` | The favicon files, for a site's root. |
81
+ | `faviconSet(brand, { small, rasterize, adaptive })` | The favicon files, for a site's root. `adaptive`: `favicon.svg` is the mark alone, in ink for the browser's light mode and paper for its dark mode (`adaptiveIcon`), not on a tile. |
82
+ | `lightDarkSet(brand, { rasterize })` | The mark for light and dark grounds: `svg/mark-for-light.svg` (ink), `svg/mark-for-dark.svg` (paper), `svg/mark-auto.svg` (follows the reader's mode), transparent PNGs at 512, 1024 and 2048, and `preview/on-light.png` / `on-dark.png`. |
82
83
  | `markFiles`, `lockupFiles` | The mark's and lockups' files. |
83
84
  | `brandSheet(brand)` | `{ svg, png }`. |
84
85
  | `brandJson(brand, files)` | `brand.json`'s contents. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logomarks/brand-kit",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "A complete brand kit from a logomark, a name, a colour and a typeface: the mark on light, dark and colour, favicons and a real .ico, outlined lockups and a round seal, a 50-950 OKLCH palette with WCAG pairings and named swatch cards, CSS and design tokens, brand.json, a brand sheet and a guidelines deck (PNG, SVG and PDF). Plus texture-collaged and letterpress, riso or stamp-printed marks, and a social pack at every platform's current sizes in four styles, with animated SVGs and seal avatars.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -9,6 +9,8 @@ export interface FaviconOptions {
9
9
  small?: string;
10
10
  /** Draw PNGs with this instead of sharp or a canvas. */
11
11
  rasterize?: Rasterize;
12
+ /** `favicon.svg` as the mark alone, its ink following the browser's light or dark mode, instead of on a tile. */
13
+ adaptive?: boolean;
12
14
  }
13
15
 
14
16
  /** How each icon is drawn. */
@@ -24,5 +26,7 @@ export const ICO_SIZES: readonly number[];
24
26
  export const HEAD_HTML: string;
25
27
  /** The web app manifest. */
26
28
  export function manifest(name: string, color: string): object;
29
+ /** The mark alone, transparent, one ink in light mode and another in dark, cropped close for a tab. */
30
+ export function adaptiveIcon(mark: { paths: string }, light: string, dark: string): string;
27
31
  /** The favicon set, as files for a site's root. */
28
32
  export function faviconSet(brand: BrandInput | Brand, options?: FaviconOptions): Promise<FileMap>;
@@ -57,14 +57,28 @@ export const manifest = (name, color) => ({
57
57
  display: 'standalone',
58
58
  });
59
59
 
60
+ /**
61
+ * A favicon that follows the browser: the mark alone, transparent, in one
62
+ * ink for light mode and another for dark, cropped close (a 480 window on
63
+ * the 512 canvas) so it is as large as a tab allows.
64
+ *
65
+ * @param {{ paths: string }} mark - The mark.
66
+ * @param {string} light - Its colour in light mode.
67
+ * @param {string} dark - Its colour in dark mode.
68
+ * @returns {string} The SVG.
69
+ */
70
+ export const adaptiveIcon = (mark, light, dark) =>
71
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="16 16 480 480"><style>g{fill:${light}}@media (prefers-color-scheme:dark){g{fill:${dark}}}</style><g>${mark.paths}</g></svg>\n`;
72
+
60
73
  /**
61
74
  * The favicon set, as files for a site's root.
62
75
  *
63
76
  * @param {import('../brand/brand.js').BrandInput | import('../brand/brand.js').Brand} input - The brand.
64
- * @param {import('./favicons.js').FaviconOptions} [o] - A simplified mark for the small sizes, and a rasteriser.
77
+ * @param {import('./favicons.js').FaviconOptions} [o] - A simplified mark for the small sizes, a rasteriser, and
78
+ * `adaptive` for a `favicon.svg` that follows the browser's light or dark mode instead of sitting on a tile.
65
79
  * @returns {Promise<import('../util/files.js').FileMap>} `favicon.ico`, `favicon.svg`, the PNGs, `site.webmanifest` and `head.html`.
66
80
  */
67
- export async function faviconSet(input, { small, rasterize } = {}) {
81
+ export async function faviconSet(input, { small, rasterize, adaptive = false } = {}) {
68
82
  const brand = await resolveBrand(input);
69
83
  const { mark, palette: p } = brand;
70
84
  const tiny = small ? loadMark(small) : mark;
@@ -73,7 +87,7 @@ export async function faviconSet(input, { small, rasterize } = {}) {
73
87
  const maskPad = padForCircle(mark, ICONS.maskable.circle);
74
88
  const files = fileMap();
75
89
  files.set('favicon.ico', ico(await Promise.all(ICO_SIZES.map(async (size) => ({ size, png: await png(markTile(tiny, { size, ...icon, ...ICONS.tile }), size) })))));
76
- files.set('favicon.svg', markTile(tiny, { size: 32, ...icon, ...ICONS.tile }).replace(' width="32" height="32"', ''));
90
+ files.set('favicon.svg', adaptive ? adaptiveIcon(tiny, p.ink, p.paper) : markTile(tiny, { size: 32, ...icon, ...ICONS.tile }).replace(' width="32" height="32"', ''));
77
91
  files.set('apple-touch-icon.png', await png(markTile(mark, { size: 180, ...icon, ...ICONS.apple }), 180));
78
92
  for (const size of [192, 512]) {
79
93
  files.set(`icon-${size}.png`, await png(markTile(mark, { size, ...icon, ...ICONS.any }), size));
package/src/index.d.ts CHANGED
@@ -11,9 +11,10 @@ export { sealLockup, sealOn, sealGeometry, SEAL, SEAL_DETAIL, SEAL_PRINT, SEPARA
11
11
  export { palette, pairing } from './color/palette.js';
12
12
  export { paletteCss, paletteTailwind, paletteTokens } from './color/tokens.js';
13
13
  export { swatches, swatchStack, swatchNameWidths, swatchCards, SWATCH_CARDS } from './color/swatches.js';
14
- export { faviconSet, manifest, ICONS, ICO_SIZES, HEAD_HTML } from './favicon/favicons.js';
14
+ export { faviconSet, adaptiveIcon, manifest, ICONS, ICO_SIZES, HEAD_HTML } from './favicon/favicons.js';
15
15
  export { ico, readIco } from './favicon/ico.js';
16
16
  export { markFiles, MARK_PNG_SIZES } from './kit/marks.js';
17
+ export { lightDarkSet, LIGHT_DARK_PNG_SIZES } from './kit/light-dark.js';
17
18
  export { lockupFiles, LOCKUP_PNG_WIDTH, SEAL_PNG_WIDTH } from './kit/lockups.js';
18
19
  export { brandSheet, SHEET } from './kit/sheet.js';
19
20
  export { guidelinesDeck, deckSlideSvg, SLIDES, SLIDE_IDS } from './deck/index.js';
package/src/index.js CHANGED
@@ -16,9 +16,10 @@ export { sealLockup, sealOn, sealGeometry, SEAL, SEAL_DETAIL, SEAL_PRINT, SEPARA
16
16
  export { palette, pairing } from './color/palette.js';
17
17
  export { paletteCss, paletteTailwind, paletteTokens } from './color/tokens.js';
18
18
  export { swatches, swatchStack, swatchNameWidths, swatchCards, SWATCH_CARDS } from './color/swatches.js';
19
- export { faviconSet, manifest, ICONS, ICO_SIZES, HEAD_HTML } from './favicon/favicons.js';
19
+ export { faviconSet, adaptiveIcon, manifest, ICONS, ICO_SIZES, HEAD_HTML } from './favicon/favicons.js';
20
20
  export { ico, readIco } from './favicon/ico.js';
21
21
  export { markFiles, MARK_PNG_SIZES } from './kit/marks.js';
22
+ export { lightDarkSet, LIGHT_DARK_PNG_SIZES } from './kit/light-dark.js';
22
23
  export { lockupFiles, LOCKUP_PNG_WIDTH, SEAL_PNG_WIDTH } from './kit/lockups.js';
23
24
  export { brandSheet, SHEET } from './kit/sheet.js';
24
25
  export { guidelinesDeck, deckSlideSvg, SLIDES, SLIDE_IDS } from './deck/index.js';
@@ -0,0 +1,9 @@
1
+ // The mark for light and dark grounds.
2
+ import type { Brand, BrandInput } from '../brand/brand.js';
3
+ import type { FileMap } from '../util/files.js';
4
+ import type { Rasterize } from '../render/png.js';
5
+
6
+ /** The transparent PNGs' sizes: 512, 1024, 2048. */
7
+ export const LIGHT_DARK_PNG_SIZES: readonly number[];
8
+ /** The mark in ink for light grounds and paper for dark ones (SVG and PNG), an SVG that follows the reader's mode, and a preview of each. */
9
+ export function lightDarkSet(brand: BrandInput | Brand, options?: { rasterize?: Rasterize }): Promise<FileMap>;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The mark for light and dark grounds: in the palette's ink for light
3
+ * grounds and its paper for dark ones, as SVG and transparent PNG, one SVG
4
+ * that follows the reader's light or dark mode, and a preview of each on
5
+ * its ground.
6
+ *
7
+ * @module kit/light-dark
8
+ */
9
+
10
+ import { resolveBrand } from '../brand/brand.js';
11
+ import { markSvg, markTile, markAutoSvg } from '../brand/mark.js';
12
+ import { toPng } from '../render/png.js';
13
+ import { fileMap } from '../util/files.js';
14
+
15
+ /** The transparent PNGs' sizes. */
16
+ export const LIGHT_DARK_PNG_SIZES = Object.freeze([512, 1024, 2048]);
17
+
18
+ /** The previews' size. */
19
+ const PREVIEW = 1024;
20
+
21
+ /**
22
+ * The light and dark set.
23
+ *
24
+ * @param {import('../brand/brand.js').BrandInput | import('../brand/brand.js').Brand} input - The brand.
25
+ * @param {{ rasterize?: import('../render/png.js').Rasterize }} [o] - A rasteriser.
26
+ * @returns {Promise<import('../util/files.js').FileMap>} `svg/mark-for-light.svg`, `svg/mark-for-dark.svg`,
27
+ * `svg/mark-auto.svg`, `png/mark-for-{light,dark}-<size>.png` and `preview/on-{light,dark}.png`.
28
+ */
29
+ export async function lightDarkSet(input, { rasterize } = {}) {
30
+ const { mark, palette: p } = await resolveBrand(input);
31
+ const ways = /** @type {const} */ ([['for-light', p.ink, p.paper], ['for-dark', p.paper, p.ink]]);
32
+ const files = fileMap();
33
+ for (const [way, ink] of ways) files.set(`svg/mark-${way}.svg`, markSvg(mark, ink));
34
+ files.set('svg/mark-auto.svg', markAutoSvg(mark, p.ink, p.paper));
35
+ for (const [way, ink] of ways) {
36
+ for (const size of LIGHT_DARK_PNG_SIZES) files.set(`png/mark-${way}-${size}.png`, await toPng(markTile(mark, { size, color: ink }), { width: size, height: size, rasterize }));
37
+ }
38
+ for (const [way, ink, ground] of ways) {
39
+ const on = way === 'for-light' ? 'on-light' : 'on-dark';
40
+ files.set(`preview/${on}.png`, await toPng(markTile(mark, { size: PREVIEW, color: ink, ground }), { width: PREVIEW, height: PREVIEW, rasterize }));
41
+ }
42
+ return files;
43
+ }