Skip to content

fix: light the comments "Displaying N comments" line in dark mode - #76

Merged
Fivell merged 1 commit into
masterfrom
fix/comments-pagination-info-dark
Oct 23, 2026
Merged

Fivell merged 1 commit into
masterfrom
fix/comments-pagination-info-dark

Conversation

@Fivell

@Fivell Fivell commented Oct 23, 2026

Copy link
Copy Markdown
Member

Problem

ActiveAdmin's base _pagination.scss ends with a .comments block that
re-colours the pagination info line:

.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 <b> inside it
matches .pagination_information b — same specificity as the base rule, and
the theme is loaded later, so the theme wins there.

Fix

Add a .comments .pagination_information selector of equal specificity to the
base one; the theme is imported after AA base, so source order decides it.

Measured

test/dummy with dark mode forced, computed color of the line:

.pagination_information its <b> panel background
before rgb(0, 0, 0) rgb(221, 226, 232) rgb(37, 41, 47)
after rgb(221, 226, 232) rgb(221, 226, 232) rgb(37, 41, 47)

rake css passes.

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 <b> 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.
@Fivell
Fivell merged commit 8a510a9 into master Oct 23, 2026
3 checks passed
@Fivell Fivell mentioned this pull request Oct 23, 2026
@Fivell
Fivell deleted the fix/comments-pagination-info-dark branch October 23, 2026 08:37
@Fivell

Fivell commented Oct 23, 2026

Copy link
Copy Markdown
Member Author
comments-pagination-after comments-pagination-before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant