From 896ec5ecc8c3f91efa2c315861d9848e143b0ef1 Mon Sep 17 00:00:00 2001 From: Igor Fedoronchuk Date: Fri, 23 Oct 2026 10:27:08 +0200 Subject: [PATCH] fix: light the comments "Displaying N comments" line in dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ActiveAdmin's base _pagination.scss closes with a .comments block that re-colours the pagination info to #000: .comments { .pagination_information { float: left; color: #000; } } Two classes outweigh the theme's single-class `.pagination_information`, so on a show page's comments panel the plain text of "Displaying 1 comment" stayed black on the dark surface. Only the count read, because the inside it matches `.pagination_information b` — same specificity as the base rule, theme loaded later, theme wins. Add a `.comments .pagination_information` selector of equal specificity; the theme is imported after AA base, so source order decides it. Measured in test/dummy with dark mode forced: the line computes to rgb(0, 0, 0) before and rgb(221, 226, 232) after, against the panel's rgb(37, 41, 47). `rake css` passes. --- app/assets/stylesheets/wigu/active_admin_theme.scss | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/wigu/active_admin_theme.scss b/app/assets/stylesheets/wigu/active_admin_theme.scss index 7495d2a..7928648 100644 --- a/app/assets/stylesheets/wigu/active_admin_theme.scss +++ b/app/assets/stylesheets/wigu/active_admin_theme.scss @@ -1469,11 +1469,14 @@ form fieldset.inputs > ol { clear: both; } .active_admin_comment_body { margin-left: 220px; } } .comments form.active_admin_comment { margin-left: 220px; } -// AA base sets `.pagination_information b { color: #5c6469 }` globally (the -// "Displaying 1 comment" line) — black-on-dark in dark mode. Re-point to the -// themed text color so it reads in both modes. +// AA base sets `.pagination_information b { color: #5c6469 }` globally and +// `.comments .pagination_information { color: #000 }` (the "Displaying 1 +// comment" line) — black-on-dark in dark mode. Re-point to the themed text +// color so it reads in both modes; the .comments copy needs a two-class +// selector of its own to outweigh the base one. .pagination_information, -.pagination_information b { color: var(--aa-text); } +.pagination_information b, +.comments .pagination_information { color: var(--aa-text); } .pagination { span > a { background-image: none;