Extending Claro theme not inheriting Claro blocks

Created on 5 July 2023, over 1 year ago

Problem/Motivation

When creating a custom admin theme based on Claro it's not picking up Claros block configuration as per:

https://www.drupal.org/docs/theming-drupal/creating-sub-themes#s-inherit...

"If a sub-theme does not supply its own block configurations, Drupal will inherit these block configurations and region placement from the base theme."

I'm instead getting blocks that belong to the sites default end user theme, such as site_branding and powered. The only way around this is to copy Claro's config/ directory to my custom admin theme and manually change any references from claro to the name of my custom theme.

Steps to reproduce

Create a brand new Drupal 10.x site, and create a theme called custom_admin_theme, with the following custom_admin_theme.info.yml file:

name: 'Custom Admin Theme'
type: theme
base theme: claro
core_version_requirement: ^10

regions:
  header: 'Header'
  pre_content: 'Pre-content'
  breadcrumb: Breadcrumb
  highlighted: Highlighted
  help: Help
  content: Content
  page_top: 'Page top'
  page_bottom: 'Page bottom'
  sidebar_first: 'First sidebar'
regions_hidden:
  - sidebar_first

Enable this theme, and do a config export or head to /admin/structure/block/list/custom_admin_theme and you'll see the block configuration doesn't match what is provided by Claro.

Proposed resolution

As I'm not declaring a config directory in my custom theme, use the block config from the base theme Claro as per documentation.

🐛 Bug report
Status

Active

Version

10.1

Component
Theme 

Last updated 6 days ago

Created by

🇦🇺Australia thomwilhelm Sydney

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

Comments & Activities

Production build 0.71.5 2024