angular / angular/components

troubleshooting(dialog): Dialog title :before psuedo element

オープン
#28,129 コメント 3 件 リアクション 3 件 担当者 0 名 GitHub で見る
area: material/dialog P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

We are doing a migration to Material Angular 16 and when attempting to style the `mat-dialog-title` of a dialog. There is a `:before` pseudo element which has an empty string as content, and I believe the purpose of this element is to set the height of the title element with the `mat-dialog-title` directive. Is this correct? This implementation seems very hacky to me and flexbox `justify-content` does not work property because this pseudo element is considered an element within a flex container, and therefore the developer either needs to create a new flex container within the `mat-dialog-title` or remove the content from the `:before` psuedo element. Am I not not thinking of this correctly and is there another way to use `justify-content` which works with this psuedo element?

### Reproduction

StackBlitz link:
Steps to reproduce:
1.
2.

### Expected Behavior

If the `mat-dialog-title` container is a flex container, `justify-content: space-between` works correctly.

### Actual Behavior

`justify-content: space-between` adds space between the psuedo element which has an empty string as content and the next element within the `mat-dialog-title`

### Environment

- Angular: 16.2.10
- CDK/Material: 16.2.9
- Browser(s): Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

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

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

調査の方向性

mat-dialog-title ディレクティブに関連付けられた Angular Material のダイアログタイトルのスタイルから始め、issue の flexbox 例を使って Firefox でレイアウトを再現します。:before 疑似要素が justify-content: space-between にどのような影響を与えるか確認します。追加のコンテナや疑似要素の手動削除を必要とせず、ダイアログタイトルの flex レイアウトが期待どおりに動作すれば完了です。

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

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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