Forum

Thread tagged as: Question, Suggestions

Admin Custom Stylesheet Loading Speed

I'm wondering if there's a way to make custom CSS load faster in the admin. As it stands, there is a split second before custom CSS is applied when an admin page loads, and so it "flickers", which is really distracting.

If I add the CSS directly to core file it works great, but of course that would be hard to maintain.

Following instructions here: https://docs.grabaperch.com/perch/control-panel/customizing/ I note this has been documented:

We appreciate that the end of the page is not the most super-ideal place to be adding new CSS files. If making big changes where this could be an issue, it may be better to look at implementing your code with an app instead.

I've looked into making an app but not sure how to output CSS. Would this be any faster anyway?

Jay George

Jay George 2 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'd use Perch->add_css() to add your stylesheet and then Perch will add it to the top of the document.

That works great, thanks