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.
In theme.info, when adding CSS files with duplicate names (although in another directory), the files don't get loaded properly.
Example:
name = mytheme
description = My custom theme
core = 7.x
stylesheets[all][] = assets/css/style.css
stylesheets[all][] = assets/fonts/montserrat/style.css
In this case, the first style.css file gets ignored completely and isn't loaded
Comments
Comment #2
speekless CreditAttribution: speekless commentedComment #3
japo32 CreditAttribution: japo32 at Catalyst IT commentedA similar issue was filed here: https://www.drupal.org/node/2303161
Comment #4
cilefen CreditAttribution: cilefen commentedBased on the other issue, this is "works as designed".
Comment #5
djalxs CreditAttribution: djalxs as a volunteer and commentedThis is, as stated by cilefen, the intended functionality for Drupal.
The reason being is so when you create a child theme you can prevent certain style sheets of the parent theme from being loaded. The same applies to JS files.
The simple workaround for this is to rename your stylesheet to
montserrat.css
. Even if not using a CMS of any description, it is always advisable to name your files something descriptive rather than juststyle.css
orscript.js
.Alternatively, as you are adding a font, why not use the @font-your-face module.
Comment #6
cilefen CreditAttribution: cilefen commented