From 6a4f7e4c7b9ed87dc2c8fb9186eb343e01aa90d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Vila=C3=A7a=20de=20Jesus?= Date: Sat, 24 Oct 2026 23:00:43 -0300 Subject: [PATCH 1/3] chore: start #551 From 732c8303ea88461e6c5e6daa0152bf006c0354ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Vila=C3=A7a=20de=20Jesus?= Date: Sat, 24 Oct 2026 23:27:04 -0300 Subject: [PATCH 2/3] feat: code surfaces get an integer px line-height token (#551) Fixes #551 --- .changeset/code-line-height-token.md | 5 ++ AGENTS.md | 2 + .../components/CodeSnippet/CodeSnippet.svelte | 7 +- .../lib/styles/code-surfaces.svelte.test.ts | 70 +++++++++++++++++++ packages/ui/src/lib/styles/prose.css | 4 +- packages/ui/src/lib/styles/tokens.css | 4 ++ .../src/content/docs/display/code-snippet.mdx | 23 ++++++ .../docs/getting-started/workarounds.mdx | 2 + 8 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 .changeset/code-line-height-token.md create mode 100644 packages/ui/src/lib/styles/code-surfaces.svelte.test.ts diff --git a/.changeset/code-line-height-token.md b/.changeset/code-line-height-token.md new file mode 100644 index 00000000..01dcb8ec --- /dev/null +++ b/.changeset/code-line-height-token.md @@ -0,0 +1,5 @@ +--- +"@codeatlasdev/ui": minor +--- + +New token `--ca-code-line-height` (20px): an integer px line height for code surfaces. `CodeSnippet`, `.ca-code pre` and a bare Markdown `pre` inside `.ca-prose` use it instead of the unitless 1.6 / 1.7, which rounded to a different pixel height in a text layer and in an overlay (a caret and an active-line highlight drifting apart). The `code` inside a `CodeSnippet` also pins `--ca-font-mono` now: it used the UA's bare `monospace`, resolved per lookup. The docs gain "Code surfaces: integer line-height, one font stack" for apps that build an editor. diff --git a/AGENTS.md b/AGENTS.md index 85652a89..61604033 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -150,6 +150,8 @@ Reading failures: locators fail with an ARIA snapshot; traces are in `__traces__ 10a. **Cursor**: never write `cursor: pointer` for a clickable element. The reset (`@layer ca.reset`) gives `pointer` to `button`, `a[href]`, `label[for]`, `summary`, `[role=button|tab|option|menuitem*]` and `not-allowed` to `:disabled` / `[aria-disabled=true]`; a custom clickable tile is `