8000 feat(ui): default to self-hosted Inter (#226) by simon-inkie · Pull Request #229 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

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
61 changes: 61 additions & 0 deletions .specs/226-default-look/SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# #226: Default Deck typography to Inter

- Issue: https://github.com/simon-inkie/inkie-deck/issues/226
- Branch: default-look-inter
- Started: 2026-11-19

## TL;DR
Default Deck to locally served Inter at a 14px-equivalent root size. Keep the
existing per-area scale, weights and colours, and use system monospace for
code. No font requests leave Deck and no font settings are needed.

## Scope
In scope:
- Compare stylesheet tokens and root layout against the reference build.
- Bundle the unmodified Inter 4.0 Latin variable faces (upright and italic,
weights 100 to 900) from the published VitePress 1.6.4 package with the
Inter copyright and SIL Open Font License 1.1. OFL allows bundling with
Deck; only the fonts are under OFL, and Deck's Apache-2.0 licence is unchanged.
- Use Inter for body and display text, with system fonts for unsupported
characters. Keep the existing heading weights and tracking.
- Set the root size to 87.5% of the browser default (14px at 16px). The
existing rem tokens then give 14.875px chat, 14px decision copy, 13.125px
composer and sidebar names, and 12.25px review copy. Keep the base and
decision leading at 1.5 and chat paragraph leading at 1.45. Review headings
stay at 1.25em and 1em; Markdown code stays at 0.85em.

Out of scope:
- Instance font profile and size controls, remote stylesheets, reference
wordmarks, League Spartan display type, and background texture.
- Changes to the palette, component type hierarchy or application behaviour.

## Test plan
- No existing tests assert the changed CSS tokens or font links, so none were
changed. The full required list was run from the repository root on a clean
tree: `pnpm typecheck`, `pnpm check:boundaries`, `node scripts/leak-gate.mjs`
(and `--self-test`), `pnpm check:leaks`, `pnpm check:licence`,
`pnpm check:lib-version`, `pnpm -C packages/deck check:dashes`,
`git diff --check origin/main...HEAD` and `pnpm test`.
- Result: all exit 0; the full suite passed.
- Browser check on a scratch copy: no request to a font CDN, bundled Inter
loads, no horizontal overflow at 1440 and 390 wide, brand colours unchanged.
The README screenshots were retaken in this look.

## Follow-ups
None.

## Log

### 2026-11-19: Adopt the reference type scale without its profiles
- What changed: Compared the styles and layout, then switched the public
design tokens to self-hosted Inter and the reference 14px-equivalent scale.
- Why: The reference CSS uses the same per-area tokens. Its custom profile
loads an HTTPS stylesheet and sets the body and optional mono families on
the root; League Spartan remains the display face. A separate validated
12 to 20px root override scales the rem values. The source shows Inter as
a custom-profile example, not the active deployment values. Use the
requested 14px scale and system mono fallback without copying runtime
configuration or requiring a CDN. No in-repo font CSP needs changing;
the same-origin files work with a self-only font policy.
- Supersedes: nothing, additive
- Commits: 490e431 feat(ui): default to self-hosted Inter (#226)
Binary file modified docs/images/agent-thread-tech.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/agent-thread.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/code-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/needs-you.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/project-board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/review-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 23 additions & 4 deletions packages/deck/app/app.css
8BD0
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
@import "tailwindcss";

@font-face {
font-family: "Inter";
src: url("/fonts/inter-roman-latin.woff2") format("woff2");
font-style: normal;
font-weight: 100 900;
font-display: swap;
}

@font-face {
font-family: "Inter";
src: url("/fonts/inter-italic-latin.woff2") format("woff2");
font-style: italic;
font-weight: 100 900;
font-display: swap;
}

/* Per-area typography tokens; rem sizes follow the root font size. */
:root {
--mc-chat-font-size: 1.0625rem;
Expand Down Expand Up @@ -92,15 +108,18 @@
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);

--font-sans: "Work Sans", ui-sans-serif, system-ui, sans-serif;
--font-display: "League Spartan", "Work Sans", ui-sans-serif, sans-serif;
--font-mono: "Space Grotesk", ui-monospace, "SF Mono", monospace;
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
--font-display: var(--font-sans);
--font-mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
}

@layer base {
* {
border-color: var(--border);
}
html {
font-size: 87.5%;
}
html,
body {
background-color: var(--background);
Expand All @@ -122,7 +141,7 @@
font-family: var(--font-mono);
text-transform: uppercase;
letter-spacing: 0.18em;
font-size: 0.6875rem; /* 11px */
font-size: 0.6875rem;
}
/* reserved for the decision card so a "needs you" card feels physical */
.shadow-retro {
Expand Down
15 changes: 0 additions & 15 deletions packages/deck/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ export async function loader() {
}

export const links: Route.LinksFunction = () => [
// Inkie webfonts (League Spartan / Work Sans / Space Grotesk). Loaded here and
// not by an @import in app.css: Tailwind inlines at the top of that file, so
// a font @import below it is no longer first and browsers drop it (#32).
// The preconnects warm the font-CDN connection for the stylesheet below.
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
{
rel: "preconnect",
href: "https://fonts.gstatic.com",
crossOrigin: "anonymous",
},
{
rel: "stylesheet",
href:
"https://fonts.googleapis.com/css2?family=League+Spartan:wght@500;700;900&family=Work+Sans:ital,wght@0,400;0,500;0,600;1,400&family=Space+Grotesk:wght@400;500;700&display=swap",
},
// PWA shell: manifest + home-screen icon. iOS only fires web push
// for sites added to the Home Screen (16.4+), and that requires both.
{ rel: "manifest", href: "/manifest.webmanifest" },
Expand Down
89 changes: 89 additions & 0 deletions packages/deck/public/fonts/OFL-Inter.txt
F381
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)

This Font Software is licensed under the SIL Open Font License, Version 1.1.

SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
Binary file not shown.
Loading
0