2

I have added a custom layout for Display Suite on Drupal 8. Everything is working except the CSS for the custom layout is not working.

This is my layout in my theme folder:

mytheme.layouts.yml

ds_3col_guide:
  label: Guide - Three column stacked 
  category: Display Suite
  class: '\Drupal\ds\Plugin\DsLayout'
  type: partial
  template: templates/ds/ds-3col-guide
  library: ds/ds_3col_guide
  icon: templates/ds/ds-3col-guide.png
  regions:
    header:
      label: Header
    left:
      label: Left
    middle:
      label: Middle
    right:
      label: Right
    footer:
      label: Footer

The CSS for this is located here: templates/ds/ds-3col-guide.css

  1. Do I add the CSS reference to mytheme.layouts.yml or to mytheme.libraries.yml?
  2. Would this be the right way to add it?

    css:
      theme:
        templates/ds/ds-3col-guide.css: {}
    

Thank you for taking the time to read this.

  • i have crated created ds-2col-stacked-custom.html.twig (my_theme/ds_layouts/ds-2col-stacked) and wrote a layout with all css classes that i need, created mytheme.layouts.yml and declared my custom layout template. when i check webpage - template works, content is rendered where it should be, css classes are asigned BUT I have same BIG issue css rules are not working. css file is located: ds_layouts/ds-2col-stacked/ds-2col-stacked-custom.css – Forey Vitaliy Jul 17 '18 at 9:58
  • 1
    had same problem, check this Creating Display Suite Custome Layout – Forey Vitaliy Aug 8 '18 at 11:22

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.