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
- Render events through a view whose row style uses a view mode mapped to
card-dated-vertical. - Inspect a card:
.card-dated-verticalhas 32px block padding and.card-bodyadds a further 16px, so the card measures 144px tall. - 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_sizeprop mirroring theheadingcomponent'stext_size— same enum, empty by default so the title keeps matching its heading level — and apply it as a class alongsidecard-dated-vertical__title, built as an array merged with|merge. - Give
.card-bodyp-0whenpaddedis off, so the component's own padding is the only padding.padded: truestill opts into the roomierp-4. - Correct the day (
$spacer * 1.625), month ($spacer) and icon circle ($spacer * 2.5) to the design values, all expressed through$spacerrather 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_sizeprop oncard-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_sizeprop 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.
Issue fork vartheme_bs5_educare-3616335
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
Comment #4
rajab natshahComment #5
rajab natshah✅ Released vartheme_bs5_educare-1.0.0-alpha2
Comment #6
rajab natshahComment #7
rajab natshah