Bug: `sx` background not applied on Card/Accordion: Theme paints an opaque background-image
Maintainer thường phản hồi trong vòng 7 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend, testing-qa
Hướng nghiên cứu
Start with createDiamondOverlays() and trace how its overlays values reach Paper-derived components through ThemeProvider. Reproduce the Card example in a browser, then verify the elevation guard and MuiAutocomplete.paper behavior while preserving the existing tokens. Done means sx background colors are visible across the listed components, with a browser pixel check covering the painting behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
Summary
sx={{ bgcolor: ... }} has no visible effect on Card or Accordion under SRU's ThemeProvider. The style is applied, but the theme paints an opaque background-image over it, and background-image always paints above background-color.
Affects every Paper-derived component at elevation > 0: Card, Accordion, Dialog, Menu, Popover, AppBar, SnackbarContent.
Expected behaviour
<Card sx={{ bgcolor: "primary.container" }}> renders with that background.
Actual behaviour
Renders the theme's elevation surface colour. The sx background is invisible and cannot be overridden by specificity or !important — it's painting order, not cascade.
Steps to reproduce
- Wrap an app in SRU's
ThemeProvider. - Render
<Card sx={{ bgcolor: "rgb(255,0,0)" }}>test</Card>. - Card is not red.
B is red, A is not:
<Card sx={{ bgcolor: "rgb(255,0,0)" }}>A</Card>
<Card sx={{ bgcolor: "rgb(255,0,0)", backgroundImage: "none" }}>B</Card>
Environment
- Package version: 0.7.1 (introduced in
aea9988/ #269; not in 0.6.x) - MUI: reported on 7.3.10; peer range is
^7.0.0 - Browser/OS: all — specified CSS painting behaviour
Additional context
Cause: createDiamondOverlays() fills MUI's overlays slot with opaque --ds-elevation-* hexes, both modes. Paper renders it as backgroundImage. That slot expects a translucent film; an opaque value hides everything beneath.
Wider impact: also covers our own colours as MuiSnackbarContent.root has never rendered, and disabled Accordion loses action.disabledBackground.
Fix: paint as background-color instead, tokens unchanged. Guard to elevation > 0 (or Alert breaks), and convert MuiAutocomplete.paper, which uses overlays[8] deliberately.
Tests won't catch it: they check the theme object, not output. jsdom can't see it either as the colour is in computed styles, just painted over. Needs a browser pixel check.
Workarounds: variant="outlined", elevation={0}, sx={{ backgroundImage: "none" }}.
Out of scope: borderRadius issue reported alongside is MUI specificity, not this bug.
- Ngôn ngữ chính
- TypeScript
- Star
- 9
- Fork
- 4
- Merge trung bình
- 7 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 29
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
-
needs-triage
Độ 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 7 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 7 ngày
-
needs-triage
Độ 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 7 ngày
-
Spacing at the top of SidebarNav should be configurableCó thể đã có người làm @swara030 đã nhận 4 ngày trước. Đang mởneeds-triage
Độ 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 7 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 7 ngày
Tất cả issue của DiamondLightSource/sci-react-ui
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug category:ai category:devices effort:s
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
LanternOps/breeze#8943 ·
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 74/100
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Divinity-Labs/Lens#341 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày