Create new SDC component for Umami (Common Card)

Created on 13 March 2023, over 1 year ago
Updated 20 October 2023, 8 months ago

Problem/Motivation

Single directory components (SDC) is a new way to theme Drupal. Instead of scattering related files around your theme, they're contained to one directory. The primary issue for SDC is at ✨ Single directory components in core Active .

As part of SDC's roadmap (see 🌱 Single Directory Components module roadmap: the path to beta and stable Active ), we want to convert an Umami component to use SDC. For this task I'm choosing the card view mode component, which includes markup and CSS.

This issue is of course blocked on actually getting SDC into core. See ✨ Add Single Directory Components as a new experimental module Fixed .

Testing instructions

  1. Make sure you have SDC module enabled, if enabling via drush si demo_umami it will be installed by the profile
  2. Clear caches
  3. Test card view mode and it's variants (most of the listings use it) - you should see HTML like the screenshot below showing that the cards are being rendered via a component

Components description:

Card Component:

1. Has optional html_tag prop with values article or div
2. Has slot content without restrictions of content inside.

Title component:
1. specific Drupal properties: title_prefix, title_suffix
2. optional html tag as property
3. In the future, it will allow us to control the typography of the site through css classes. EG: `.umami-title--h1 {}` what is better that `h1 {}`
In terms of BEM: https://en.bem.info/methodology/quick-start/#block `You also shouldn't use CSS tag or ID selectors when using BEM.`

Read more component used only in cards for now. But it can be reused everywhere now.

✨ Feature request
Status

Fixed

Version

11.0 🔥

Component
Umami  →

Last updated 10 days ago

  • Maintained by
  • 🇮🇪Ireland @markconroy
  • 🇬🇧United Kingdom @smaz
  • 🇬🇧United Kingdom @kjay
  • 🇺🇸United States @shaal
Created by

🇮🇪Ireland markconroy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024