Skip to content

add possibility to prepend or append scripts and stylesheets in admin #259

@jmartsch

Description

@jmartsch

I find myself often in situations where I modify the admin to my needs. To do that I have to override styles and add JavaScripts. They are added either via a module or in site/init.php.

$config->scripts->add($config->urls->templates . "admin/admin.js");
$config->styles->add($config->urls->templates . "admin/admin.css");

The problem with this approach is, that I can not really add/append them BEFORE/AFTER all other modules (for example core modules) added their assets.

For example if I want to modify the CSS of ProcessPageLister I have to add !important to my rules, which is bad practice, because my admin.css gets loaded first, and then the ProcessPageLister.css is loaded afterwards.

So it would be nice if we had the possibility to prepend or append scripts and stylesheets in the admin.

I know I could modify the ProcessPageLister.scss and generate the CSS, but that would destroy upgradeability of the module as the styles are then overwritten again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions