Skip to content

DataTable's small font size also shrinks the text in CardView cards #4594

Backlog

Description

@brian-smith-tcril

Note

This issue was written by Claude (Claude Code) and reviewed before posting.

Goal: a card rendered by CardView inside a DataTable has the same text sizes as the same card anywhere else on the page.

Why: .pgn__data-table-wrapper sets font-size: var(--pgn-typography-font-size-sm), which is 87.5%:

.pgn__data-table-wrapper {
font-size: var(--pgn-typography-font-size-sm);

That wrapper holds everything DataTable renders, CardView included:

<div className={classNames('pgn__data-table-wrapper', {

So every percent-sized piece of text in a card is scaled by a further 87.5%. Computed from the default theme's tokens (18px base): a Badge (--pgn-typography-badge-font-size: 75%) and Card.Footer's text (--pgn-typography-footer-text-font-size, which is --pgn-typography-font-size-xs, 75%) are 13.5px in a card outside a DataTable and 11.8px in the same card inside a CardView. Rem-sized text in the card, such as Card.Header's title and subtitle, is not scaled, so the card's proportions change and not only its size.

The small size was added for the table. #1009 (released in 17.3.1) describes it as "Font size equals to $font-size-sm for all elements in the table." Its review asked for the Figma spec for DataTable to be followed, "the font sizes within the filters and actions stay normal size, but the "Showing 1 - 50..." both above and below the table contents and the table contents themselves should have $font-size-sm", and the rule ended up on the wrapper. CardView was already part of DataTable when that merged, and nothing in the PR mentions cards.

Current example: openedx/frontend-app-catalog#176 renders the same course card on a home page (no DataTable) and on a catalog page (CardView). Its author found the badge and the footer date smaller on the catalog page and works around it with a class passed to CardView's className:

.catalog-card-view {
  font-size: var(--pgn-typography-font-size-base);
}

Where it hits: a code search of the openedx org for CardView (default branches, 2026-12-04) finds four call sites on Paragon 23. Three have card text scaled by the wrapper, all of it percent-sized:

The fourth, authoring's taxonomy list, has nothing scaled: TaxonomyCard pins its description at 18px. None of the four cards has text with no size of its own, which would inherit the wrapper's size as well, since .pgn__card sets no font-size.

Release: this is a fix: on release-23.x. It changes the rendered text size of existing CardView cards, so the PR includes before and after screenshots to show that the visual difference is small.

Claude Plan

Two candidate fixes, to choose between:

  1. Reset in the card view. Add font-size: var(--pgn-typography-font-size-base) to .pgn__data-table-card-view in src/DataTable/index.scss. One rule, and the table, status lines and footer keep the small size. It pins card text to the base size whatever the DataTable is nested in.
  2. Scope the small size to the table. Move font-size off .pgn__data-table-wrapper and onto the parts the [BD-46] feat: update DataTable font size to be small #1009 review named: the table contents and the "Showing x of y" status text above and below them. Cards then inherit from the page like any other card. It touches more selectors, and anything else in the wrapper that relied on the inherited small size has to be checked.

Either way: screenshot the DataTable docs page's table and card view examples before and after for the PR, and note the change in rendered card text size in the release notes.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions