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 #3313520: Single directory components in core.
The Demo Umami team has decided that their theme can depend on an experimental module like SDC. This allows us to have the work in this ticket merged even when #3352256: [META] Move code from the experimental SDC module to core is not committed.
Disclaimer component
The disclaimer is a custom block type and content block that appears after the footer. It displays content from two text fields: disclaimer and copyright.

As part of SDC's roadmap (see #3345922: Single Directory Components module roadmap: the path to beta and stable), we want to convert Umami components to use SDC. For this task I'm choosing the Disclaimer component, which includes markup and CSS.
This component is a good fit because: it is a simple introduction to creating a SDC that replaces nested CSS selectors with BEM syntax and preserves block field display configuration.
This component involves the following Twig templates, CSS, assets, and libraries:
- disclaimer.css
- disclaimer.twig
- block--bundle--disclaimer-block.html.twig
Testing instructions
- Set up site with Umami profile.
- View page and see that disclaimer and copyright are visible below footer.
- Inspect markup with twig debug enabled and verify that component is being used.
- Modify the disclaimer block settings and verify that the component works with the different settings, such as hiding the copyright, enabling the disclaimer field label, etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | umami-disclaimer-copyright-annotated-2.png | 133.78 KB | amanire |
Issue fork drupal-3365451
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:
- 10.1.x
changes, plain diff MR !4190
- 3365451-create-new-sdc
changes, plain diff MR !4126
Comments
Comment #3
amanire commentedComment #4
amanire commentedComment #5
amanire commentedComment #6
amanire commentedComment #7
amanire commentedComment #8
amanire commentedComment #9
amanire commentedComment #10
amanire commentedComment #11
smustgrave commentedGreat to see these start to come through.
But this caused some nightwatch failures https://dispatcher.drupalci.org/job/drupal_patches/186046/console
Comment #12
amanire commented#block-umami-branding is missing? That's very odd, since I had started working on that component first but didn't think I had committed anything and the merge request diff only shows work on the disclaimer. I'll take a closer look when I can find time.
Comment #14
gauravvvv commentedRemoved disclaimer.css file from libraries and added description in schema file.
Comment #15
smustgrave commentedSeemed to cause some nightwatch failures.
Comment #17
amanire commentedThis passed testing after enabling the SDC module.
Comment #18
smustgrave commentedApplied the MR and did a fresh install of umami profile.
Verified the disclaimer appeared at the bottom with the same styling as before.
Comment #19
lauriiiComment #20
amanire commented@lauriii I assume you mean in
disclaimer.component.yml? Happy to do that if you can confirm.Comment #21
lauriii@amanire Yes, that's the file I thought we should edit 👍
Comment #22
smustgrave commentedComment was removed.
Comment #26
lauriiiCommitted 103b774 and pushed to 11.x. Also cherry-picked to 10.1.x because Umami is internal/experimental. Thanks!