Change Proposal: Align Button and IconButton with the design (sizes, radius)
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
Hướng nghiên cứu
This is a design proposal; no implementation files or tests are named. Start by reading the Button and IconButton implementations and their stories, then compare their current sizing and radius with the stated Figma values. Done means both components use the specified 32/36/40px heights and matching radius, with stories, guidance, and changelog updated; first wait for maintainer review and acceptance.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What is being proposed?
Bring Button and IconButton in line with the DiamondDS Figma design:
- Explicit, whole-pixel heights for
ButtonandIconButtonat eachsize, instead of sizes derived from MUI padding and line-height. - Square
IconButtonwith the same corner radius asButton(MUI default is round).
Text field sizing and an outlined IconButton are related but are out of scope here. Each will be proposed separately (see "Related, separate proposals").
Why is this needed?
-
Code and Figma disagree, and the code values are fractional:
Control Figma (S / M / L) sci-react-ui today (MUI) Button32 / 36 / 40 30.75 / 36.5 / 42.25 IconButton32 / 36 / 40 34 / 40 / 48 Fractional heights give blurry borders and misaligned rows.
IconButtonis up to 8px larger than the design at large. -
Small
Buttonand smallIconButtondo not line up in the same row (30.75 vs 34). -
A plain
IconButtonhas no border or fill until hover, so a standalone "+" next to a search field reads as decoration rather than as a control. -
A round
IconButtonnext to rectangular buttons, inputs and toggle buttons looks inconsistent.
What will change?
- Behaviour: none. Only appearance and dimensions change.
- Sizes:
ButtonandIconButtonget explicit heights (IconButtonis square: width = height), withbox-sizing: border-boxso outlined and contained variants stay the same height.Button: 32 / 36 / 40.IconButton: 32 / 36 / 40.
- Radius:
IconButtonuses the same radius asButton. - Stories, guidance and the changelog are updated.
Interface changes (if any)
None. No new props. The existing size values (small, medium, large) keep their names but map to the new dimensions.
<IconButton aria-label="New file" size="small"><Add /></IconButton> // now 32×32, square
No change to existing props. The existing size values (small, medium, large) keep their names but map to the new dimensions.
Breaking change?
- Yes
It is not an API break, but it is a visible change for apps already using these components:
IconButtonis smaller (small 34 → 32, medium 40 → 36, large 48 → 40) and square instead of round.Buttonchanges by about 1–2px (small 30.75 → 32, medium 36.5 → 36, large 42.25 → 40).- Apps that override
IconButtonsize or radius withsxshould check their overrides.
Mitigation: note it in the changelog and release notes, and tell teams with apps on the library before release so they can check their layouts.
Related, separate proposal: text field sizes
Not part of this change, but they affect it.
- Text field sizes: small (40) and medium (56) match Figma but not the 32 / 36 / 40 button scale, so a small field is 8px taller than a small
ButtonorIconButton. A separate proposal will cover smaller field sizes, the default size and floating labels in dense fields. Until then, a small field (40) pairs exactly with a largeButtonorIconButton(40). - Outlined
IconButton: a newvariant="outlined"so a standalone icon action (for example "new file" next to a search field) has a visible border at rest. It is not in Figma yet, so the design comes first.
Next steps
A maintainer will review this issue.
If accepted, it will be marked as accepted and a PR may then be opened.
- Ngôn ngữ chính
- TypeScript
- Star
- 9
- Fork
- 4
- Merge trung bình
- 3 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DiamondLightSource/sci-react-ui
-
accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DiamondLightSource/sci-react-ui#325 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DiamondLightSource/sci-react-ui#283 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
accepted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
DiamondLightSource/sci-react-ui#357 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Spacing at the top of SidebarNav should be configurableCó thể đã có người làm @swara030 đã nhận 19 ngày trước. Đang mởaccepted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
DiamondLightSource/sci-react-ui#334 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
needs-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
DiamondLightSource/sci-react-ui#332 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của DiamondLightSource/sci-react-ui
Issue tương tự
-
Replace discontinued crypto-js in the themeCó thể đã có người làm @aelmanaa đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
PaloAltoNetworks/docusaurus-openapi-docs#1689 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
solana-foundation/solana-web3.js#4015 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
formatSearchQuery drops the :present modifier, so `email:present=true` is sent as `email=true`Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
ivopogace/opencode-courier#422 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
chapel-lang/chapel-vscode#158 ·
Maintainer thường phản hồi trong vòng 1 ngày