Problem/Motivation

The card-dated-vertical component has two problems that surface as soon as it is used to render real content in a listing.

1. The card is padded twice. The SCSS carries this comment:

// 32px block / 24px inline padding — overrides the p-4/p-3 utility applied
// in the twig, which is 24px uniform.
padding: #{$spacer * 2} #{$spacer * 1.5};

The rule cannot override anything: it targets .card-dated-vertical, while the utility it means to beat (p-3) sits on .card-body, a child element. Both therefore apply, giving 96px of vertical padding where the design asks for 64px, and a card 144px tall instead of ~110px.

2. The title's size cannot be set without changing its heading level. heading_level is the only control, and it drives both the tag and the typography. A content template that wants the design's 18px title has to declare h5, which skips heading levels (h2 → h5) and is reported by Editoria11y. The theme's own heading component already solves this by separating level (the tag) from text_size (a Bootstrap typography utility, "leave empty to match the selected heading level"); this component simply lacks the equivalent.

Three values also disagree with the design: the day is 28px where the design says 26px, the month 12px where the design says 16px, and the action icon a 48px circle where the design says 40px.

Steps to reproduce

  1. Render events through a view whose row style uses a view mode mapped to card-dated-vertical.
  2. Inspect a card: .card-dated-vertical has 32px block padding and .card-body adds a further 16px, so the card measures 144px tall.
  3. Try to set the title to the design's 18px: the only lever is heading_level, which also changes the tag and skips heading levels.

Proposed resolution

  • Add a title_size prop mirroring the heading component's text_size — same enum, empty by default so the title keeps matching its heading level — and apply it as a class alongside card-dated-vertical__title, built as an array merged with |merge.
  • Give .card-body p-0 when padded is off, so the component's own padding is the only padding. padded: true still opts into the roomier p-4.
  • Correct the day ($spacer * 1.625), month ($spacer) and icon circle ($spacer * 2.5) to the design values, all expressed through $spacer rather than px.

With these in place a content template can keep heading_level: h3 for the document outline and set title_size: h5 for the design's 18px, and the card measures 110px.

Note for reviewers: adding a prop mints a new component version, so config that uses title_size must also move its component_version pin forward. The previous version is retained, so existing content keeps rendering — verified against pages that pin the old hash.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ✅ UX/UI designer responsibilities
  • ✅ Readability
  • ✅ Accessibility
  • ➖ Performance
  • ➖ Security
  • ✅ Developer Documentation
  • ➖ User Guide Documentation
  • ➖ Reviewed by human
  • ➖ Code review by maintainers
  • ➖ Full testing and approval
  • ➖ Credit contributors
  • ➖ Review with the product owner
  • ✅ Release notes snippet
  • ✅ Release vartheme_bs5_educare-1.0.0-alpha2

User interface changes

  • Dated cards lose the doubled padding and match the design's height.
  • The day, month and action-icon sizes match the design.
  • A title can be sized independently of its heading level.

API changes

  • New optional title_size prop on card-dated-vertical. Additive: existing usages are unaffected, since an empty value keeps the title matching its heading level.

Data model changes

  • N/A

Release notes snippet

  • Added a title_size prop to the Dated Vertical Card so a title can be sized without changing its heading level, removed the card's doubled padding, and corrected the day, month and action-icon sizes to the design.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed 5e5087cc on 1.0.x
    feat: #3616335 Add a title_size prop to the Dated Vertical Card and stop...
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Assigned: Unassigned » josebc
Issue summary: View changes
Status: Active » Needs review
Issue tags: +vartheme_bs5_educare-1.0.0-alpha2
rajab natshah’s picture

Assigned: josebc » mohammed j. razem
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.