Action links render in the wrong colour in dark mode
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/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, scss, typescript
Hướng nghiên cứu
Bắt đầu trong frontend/web/styles/styles.scss quanh dòng 88, nơi có quy tắc body.dark a, và so sánh với lớp .text-action được tạo trong frontend/web/styles/_token-utilities.scss. Thêm quy tắc cụ thể hơn a.text-action vào trong khối body.dark, sau đó sửa anchor View Docs trong frontend/web/components/pages/CreateOrganisationPage.tsx quanh các dòng 149-151 bằng cách thêm ms-1 và bỏ {' '} đã chết. Hoàn tất nghĩa là liên kết vẫn giữ màu tím ở chế độ tối cộng với một khoảng trống nhìn thấy được ở cả hai theme, được kiểm tra trên trang Create Organisation và kiểm tra ngẫu nhiên so với các anchor .text-action khác được liệt kê.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
How are you running Flagsmith
- SaaS at flagsmith.com
Describe the bug
Links that use the text-action utility render in the default dark-mode anchor colour instead of the action purple.
The clearest example is the View Docs link on the Create Organisation page, next to "What is your company's desired hosting option?". In light mode the link is purple. In dark mode it is light grey, almost the same colour as the label text, so it no longer reads as a link.
The same link also has no gap after the question mark, so the line renders as "option?View Docs". That second defect appears in both themes.
Steps To Reproduce
- Open
https://app.flagsmith.com/createwith the light theme. The View Docs link is purple. - Switch the theme to dark mode.
- The same link is now light grey, close to the label colour. No gap separates it from the question mark in either theme.
Expected behavior
An action link keeps the purple action colour in both themes, and a space separates it from the text before it.
Root cause
frontend/web/styles/styles.scss:88 contains a legacy anchor rule.
body.dark {
background-color: $bg-dark500;
a {
color: $anchor-color-dark;
}
}
body.dark a is more specific than the single .text-action class generated in frontend/web/styles/_token-utilities.scss, so the --color-text-action token never applies to an anchor in dark mode. $anchor-color-dark resolves to slate-200, a light grey that is close to the default text colour on a dark surface.
Spans with the same class are unaffected, which is why only links look wrong. Other .text-action anchors in the app have the same defect in dark mode.
web/components/Breadcrumb.tsx:19web/components/pages/OnboardingPage.tsx:123web/components/pages/OnboardingPage.tsx:132web/components/pages/MetricsPage.tsx:249web/components/EnvironmentDocumentCodeHelp.tsx:60web/components/modals/CreateAuditLogWebhook.tsx:107web/components/modals/CreateWebhook.tsx:105web/components/modals/payment/Payment.tsx:142web/components/modals/payment/Payment.tsx:151web/components/pages/CreateOrganisationPage.tsx:151
The missing gap has a separate cause. FieldLabel renders a flex row through d-flex align-items-center, so a whitespace text node between the label text and the anchor collapses at the flex item edge. The {' '} on CreateOrganisationPage.tsx:149 has no effect.
Suggested fix
Add one rule inside the body.dark block, after the a rule.
body.dark {
background-color: $bg-dark500;
a {
color: $anchor-color-dark;
}
a.text-action {
color: var(--color-text-action);
}
}
The new rule compiles to body.dark a.text-action, which is more specific than body.dark a, so it restores the token colour for every action link in dark mode. A bare a.text-action would not be enough, because it has fewer type selectors than body.dark a.
Then give the View Docs anchor ms-1 and remove the dead {' '} for the gap.
Screenshots
Light and dark mode screenshots of the View Docs link on the Create Organisation page are attached below.
- Ngôn ngữ chính
- Python
- Star
- 7.4k
- Fork
- 613
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 144
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 Flagsmith/flagsmith
-
Fix Button Alignment in SDK Installation SectionCó thể đã có người làm @manueldezman đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Flagsmith/flagsmith#9056 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidanceCó thể đã có người làm @jcd1991 đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Flagsmith/flagsmith#9045 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Flagsmith/flagsmith#9013 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose whether an organisation is blocked for API usageCó thể đã có người làm @PiUnknown đã nhận 35 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Flagsmith/flagsmith#8773 · 1 bình luận ·
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 75/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Flagsmith/flagsmith
Issue tương tự
-
bug game: 0100FF500E34A000 game: 0400FF500E34A001 mac packing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
jxxghp/MoviePilot#7576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/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 64/100
jbaruch/software-factory#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày