Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By f0ns on
I tried to create a Drupal 8 child theme of Bartik. The problem is that the CSS of my child theme is loaded above the css of Bartik on all pages.
mytheme.info.yml file:
name: mytheme
type: theme
description: 'mytheme theme based on Bartik'
core: 8.x
package: custom
base theme: bartik
stylesheets:
all:
- css/mytheme.css
Anyone has a clue what goes wrong here?
Comments
There in Bartik theme css
There in Bartik theme css calling as library that why u got your custom css first. Do this way:
create mytheme.libraries.yml
and in mytheme.info.yml file:
happy digging
thanks, this works perfectly.
thanks, this works perfectly. I should have checked the code of Bartik better I guess. I used the documentation as an example (https://www.drupal.org/node/2165673). I guess this needs to be updated.
I think it going to be good
I think it going to be good hobbit now put you customs in library.
Fix documentation for js as well
style.css is not including.
I am using same code as on https://www.drupal.org/node/2165673, but my style.css is not showing on view source code.
Well that certainly doesn't
Well that certainly doesn't work. I wish it did.