Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

💡 Per-child align-self

オープン
#70 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
c, typescript
領域
cli

調査の方向性

まず ops.ts の layout フィールド定義、src/clayterm.c:499 のデコード経路、そして test/align-self.test.ts の失敗しているテストを確認します。レイアウトパスを追って、交差軸の配置がどこで適用されているかを確認してください。テストが通り、alignSelf を持つ子が親の配置を上書きでき、他の子は親の配置を維持できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Is your feature request related to a problem?

A container's cross-axis alignment (alignX / alignY) applies to all its children at once—there's no way for a single child to align differently. In a top-to-bottom column that left-aligns its children, you can't right-align just one of them. The single-child workaround of promoting a child's alignment onto the parent breaks the moment two children need divergent alignment.

Describe the solution you'd like

A per-child alignSelf on layout that overrides the parent's cross-axis alignment for that one element:

open("b", {
  layout: {
    width: fit(),
    alignSelf: "flex-end", // override just this child to the cross-axis end
  },
});

alignSelf should mirror the CSS align-self property, and its values should use the string-literal form from the alignment refactor in #42 (re: #3). Children without alignSelf keep following the parent's alignment. The "stretch" value (fill the cross axis) is the alignment-side equivalent of the stretch() sizing axis in #71.

Describe alternatives you've considered

Wrapping the odd-one-out child in its own intermediate container with a different alignX works for one case but bloats the tree and doesn't compose—every divergently-aligned child needs its own wrapper.

Additional context

Failing test case on nm/repro/align-self (test · diff).

Clay exposes only container-level childAlignment; per-child alignSelf needs a field on the element's layout (ops.ts), decoded in reduce (src/clayterm.c:499), and applied as a cross-axis override in the layout pass.

主要言語
TypeScript
スター
42
フォーク
2
平均マージ
2日 5時間
マージ済み PR(30日)
12

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bombshell-dev/tty のほかの issue

bombshell-dev/tty の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。