angular / angular/components

bug(bottom sheet): align bottom sheet with m3 specs

未关闭
#32,095 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area: material/bottom-sheet P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
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

Hi Angular Material team!
I would like to highlight that the bottom sheet implementation and Material 3 specification seems to have diverged.

There is a specification for sizes and responsive behaviour of bottom sheet mentioned here: https://m3.material.io/components/bottom-sheets/specs

Right now, the workaround is to modify some CSS manually. Unfortunately, the required values are not exposed via `--mat-sys` CSS variables, so the workaround ends up using internal CSS classes selectors. In some cases, it might require using `!import` if styles are not wrapper in some parent CSS class - which is considered an anti-pattern.

Here is a version with bottom sheet styles overwrites to match Material 3 specification:
https://stackblitz.com/edit/3dhv1nhh?file=src%2Fstyles.css

Please let me know if you need any help with this in case the bug or story gets picked up — happy to support!

### Reproduction

StackBlitz link (from official material.angular.io page): https://stackblitz.com/run?file=src%2Fexample%2Fbottom-sheet-overview-example.ts&startScript=start
Steps to reproduce:
1. Open side sheet on mobile, tablet and desktop breakpoints

### Expected Behavior

- bottom sheet implementation is aligned with Material 3 specification
- with responsive width of bottom sheet, mat-bottom-sheet-container-medium, mat-bottom-sheet-container-large and mat-bottom-sheet-container-xlarge are no longer needed.

### Actual Behavior

- bottom sheet does not comply with Material 3 specification

### Environment

- Angular: 20.2.0
- CDK/Material: 20.2.0
- Browser(s): Chrome (and any other)
- Operating System (e.g. Windows, macOS, Ubuntu): macOS 26 (and any other)

贡献指南

打开贡献指南

调研方向

从 Material 3 bottom sheet 规范和 src/example/bottom-sheet-overview-example.ts 中的官方示例开始;将其在移动设备、平板电脑和桌面端断点下的行为与 src/styles.css 中显示的样式进行比较。完成标准是 bottom sheet 遵循指定的响应式尺寸,而不需要内部 CSS 选择器、!important 或 medium、large 和 xlarge 容器类。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
design, frontend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。