0

I'm tryign to create a subtheme of Corporate lite (https://www.drupal.org/project/corporate_lite) following the instructions on https://www.drupal.org/docs/8/theming-drupal-8/creating-a-drupal-8-sub-theme-or-sub-theme-of-sub-theme I've created mytheme.info.yml

name: mytheme
type: theme
description: My custom child theme
core: 8.x
# Defines the base theme
base theme: corporate_lite
# Defines libraries group in which we can add css/js.
libraries:
  - mytheme/global-styling

# Regions
regions:
  slideout: 'Slideout'
  header_top_highlighted_first: 'Header Top Highlighted First'
  header_top_highlighted_second: 'Header Top Highlighted Second'
  header_top_first: 'Header Top First'
  header_top_second: 'Header Top Second'
  header_first: 'Header First'
  header: 'Header Second'
  header_third: 'Header Third'
  banner: 'Banner'
  system_messages: 'System Messages'
  content_top: 'Content Top'
  content_top_highlighted: 'Content Top Highlighted'
  content: 'Content'
  sidebar_first: 'Sidebar First'
  sidebar_second: 'Sidebar Second'
  content_bottom_first: 'Content Bottom First'
  content_bottom_second: 'Content Bottom Second'
  featured_top: 'Featured Top'
  featured: 'Featured'
  featured_bottom: 'Featured Bottom'
  sub_featured: 'Sub Featured'
  highlighted_top: 'Highlighted Top'
  highlighted: 'Highlighted'
  footer_top_first: 'Footer Top First'
  footer_top_second: 'Footer Top Second'
  footer_first: 'Footer First'
  footer_second: 'Footer Second'
  footer_third: 'Footer Third'
  footer_fourth: 'Footer Fourth'
  footer_fifth: 'Footer Fifth'
  footer_bottom: 'Footer Bottom'
  sub_footer_first: 'Subfooter First'
  footer: 'Subfooter Second'
  hidden_blocks_collection: 'Hidden blocks collection'

and mytheme.libraries.yml

global-styling:
  css:
    component:
      css/style.css: {}

Both files are placed in a folder called mytheme. When I enable my custom theme it doesn't load any of the base theme's style. My custom css placed at mytheme/css/style.css it's loaded, though. What am I doing wrong?

  • Try to replace "component" in the mytheme.libraries.yml with "theme". global-styling: css: theme: css/style.css: {} – nihilistenhymne Jan 22 at 19:37
  • Oh and did you clear the cache? – nihilistenhymne Jan 22 at 20:04
  • Replaced "component", nothing happened, also cleared cache – Alejandro Morgado Jan 29 at 14:06
  • Maybe you should add your base themes libraries also. – Insasse May 7 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.