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.
Drupal allows us to replace core/module CSS files from the theme by simply using the same filename (ex: if you add a stylesheet called system.messages.css in your theme, it will replace core's system.messages.css). This doesn't work with LESS files because the filename is different. The fix for this is pretty easy - patch attached.
Comment | File | Size | Author |
---|---|---|---|
less-allow_css_replacement_with_less.patch | 530 bytes | rbayliss | |
Comments
Comment #1
rbayliss CreditAttribution: rbayliss commentedComment #2
corey.aufang CreditAttribution: corey.aufang commentedTake a look at #1267620-2: LESS processing doesn't work on system css files..
This is the method that I personally use if I need to replace a built in file with a theme LESS file.
I'm changing this to be a reminder for me to add this to the documentation.
Comment #3
torotil CreditAttribution: torotil at more onion commentedIMHO this could easily be added by implementing
hook_system_info_alter()
and automatically adding an additional CSS file for each LESS file specified - like mentioned in #2.