Text and button items of one compact row draw at different heights: reset 'font: inherit' resets line-height, no shared item primitive
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start by reading styles/reset.css and the existing Chip, Badge, StatusChip, and Button implementations to understand the kit’s item patterns. Then check the theming guide and layout test setup; the issue calls for a shared text and button item primitive with a test showing both variants align, plus documentation of the font: inherit ordering. Done means the variants share a text top in the layout test and the shorthand behavior is documented.
索引モデルが issue の本文から書いたものです。
説明
What happens
Items of one compact row that mix element types, a text <span> and <button> actions (a status bar: Spaces: 2, UTF-8, LF, JSON), draw their text at different heights. Seen in Atlas Desktop's editor status bar: UTF-8 (a <span>) was 3.25 px higher than the buttons (WebKit, Range.getBoundingClientRect().top: 8.98 vs 12.23 for an 18px box, 11.5px font).
Root cause
Two kit behaviours combine, and the kit has nothing that owns the shape:
styles/reset.css:1(installed 4.6.0):button,input,select,textarea{font:inherit}.fontis a shorthand and resetsline-height, so every button takes its parent'sline-heightinstead of the UA'snormal. In a compact row (line-height: 1) a button's line box is the font height, and the UA centres a button's content vertically in its box; a<span>has no such centring and puts the line at the top of its box. In a fixed-height item (height: 18px) the two differ by(height - line box) / 2.- An app that writes
line-height: 18pxbeforefont: inherit(the natural order when starting from the reset) silently loses the first: the same shorthand-resets-longhand trap, one level up. Atlas did exactly that.
The kit ships no primitive for "one box for text and action items in a row" (Chip is a pill with its own height tokens, Badge/StatusChip are not actionable, Button brings padding and min touch height), so each app writes the box by hand and gets this wrong.
Minimal reproduction
<style>
.row { display: flex; align-items: center; line-height: 1; font-size: 11.5px }
.item { display: block; height: 18px; line-height: 18px; padding: 0 6px; border: 0; background: none; font: inherit }
</style>
<div class="row"><button class="item">Spaces: 2</button><span class="item">UTF-8</span></div>
WebKit: the button's text top is 12.23, the span's 8.98 (the font shorthand cancels line-height: 18px).
Expected
Either a documented, tested primitive (e.g. InlineItem / StatusBarItem: button and span variants, display: inline-flex; align-items: center; height; line-height after font), or at least a note in the theming guide about font: inherit in the reset and compact rows.
Proposed fix
Add the primitive to the kit with a layout test (both variants have the same text top), and keep reset.css as it is but document the shorthand/longhand order. If preferred, change the reset to font-family: inherit; font-size: inherit; font-weight: inherit so a button keeps line-height: normal... (breaking for apps relying on the inherit; hence the primitive/doc option first).
Workaround in Atlas
codeatlasdev/atlas#504: one StatusItem.svelte primitive (span or button, shared box, line-height after font) used by every status bar item including the language-server trigger; statusBaseline.test.ts pins it. Documented with the removal condition in docs/desktop.md ("UI kit workarounds").
- 主要言語
- TypeScript
- スター
- 6
- フォーク
- 3
- 平均マージ
- 5時間 21分
- マージ済み PR(30日)
- 378
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codeatlasdev/ui のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
codeatlasdev/ui#1340 ·
メンテナーはふだん 1 日以内に返信
-
area:a11y area:components bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
codeatlasdev/ui#1336 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
codeatlasdev/ui#1329 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
codeatlasdev/ui#1292 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:components enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
codeatlasdev/ui#1198 ·
メンテナーはふだん 1 日以内に返信
codeatlasdev/ui の issue をすべて見る
似ている issue
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskオープン
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
sandbox-quantum/switch#2163 ·
メンテナーはふだん 1 日以内に返信
-
automated issue report
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area/dashboard kind/bug QA/dev-automation
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug pydanty:is-working
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
pydantic/pydantic-ai#13939 ·
メンテナーはふだん 1 日以内に返信
-
self-host
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
funmusicplace/mirlo#2625 ·
メンテナーはふだん 1 日以内に返信