0

I created a sub-theme of the Drupal8 W3CSS theme and followed their directions about copying and renaming files, and editing the info.yml file. I installed it, and set it as default theme. It works. (I can see my custom logo.) The styles.css file is not coming from my files, but from the default sub-theme, which I haven't enabled. When I view the source of a page, I see the following tag, which doesn't contain the path for the CSS file used in my sub-theme.

<link rel="stylesheet" media="all" href="/themes/d8w3css/drupal8_w3css_subtheme/css/styles.css?qbo25b" />

It could be I missed a step.

Do I have to do something with Composer after changing any .yml file of the theme? I did clear all the cache bins.

5
  • Without seeing the theme files, answering is most like blindfolded shooting. Did you check every template file? If there isn't anything there, it could be a hook implementation that changes a file path. I would rather search for drupal8_w3css_subtheme in all the files your theme is using.
    – avpaderno
    Commented Jun 9, 2020 at 18:10
  • Side note: You should put contrib themes under themes/contrib/ and your custom sub-theme under themes/custom/.
    – leymannx
    Commented Jun 9, 2020 at 21:39
  • Thanks for the suggestions. Yes, I did a text search for drupal8_w3css_subtheme but couldn't find any references. Might have to walk through it with a debugger. I've done a lot of Drupal 7 theming, this is my first 8 project, lots of things to learn yet. I agree with creating contrib and custom subpaths. I installed the theme from the appearance page, and it didn't give me an option for destination, I would think they would figure it was a contrib and put it in the better place..
    – pglatz
    Commented Jun 9, 2020 at 22:26
  • In which path is the theme installed? Instead of /themes/d8w3css/drupal8_w3css_subtheme, what should you see?
    – avpaderno
    Commented Jun 10, 2020 at 6:55
  • Yes, the user interface installs the themes in /themes, not /themes/contrib. That's not something you can change.
    – avpaderno
    Commented Jun 10, 2020 at 7:02

1 Answer 1

0

In Drupal 8 you setup your subtheme libraries in subtheme.libraries.yml. These libraries are then loaded from subtheme.info.yml.

You should check the paths in those files if they are correct.

It's good practice to search for all occurrences of the base_theme's machine_name inside your subtheme folder and replace those with the machine_name of your subtheme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.