Repository navigation
Description
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%:
paragon/src/DataTable/index.scss
Lines 13 to 14 in bef2e14
| .pgn__data-table-wrapper { | |
| font-size: var(--pgn-typography-font-size-sm); |
That wrapper holds everything DataTable renders, CardView included:
paragon/src/DataTable/index.jsx
Line 229 in bef2e14
| <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:
- openedx/frontend-app-catalog, the catalog page on
master:Card.Footer's start date, rendered by thisCardView. - openedx/frontend-app-learning, the course-exit recommendations:
Card.Footer's text, rendered by thisCardView. - openedx/frontend-app-authoring, the files and videos tables: the
Chiplabel inGalleryCard, rendered by thisCardView.
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:
- Reset in the card view. Add
font-size: var(--pgn-typography-font-size-base)to.pgn__data-table-card-viewinsrc/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 theDataTableis nested in. - Scope the small size to the table. Move
font-sizeoff.pgn__data-table-wrapperand 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.
Activity
review frontend-app-catalog#176: openedx/paragon#4594 created, CardVi…
review frontend-app-catalog#176: org sweep of CardView call sites for o…