getgrav / grav-plugin-login

Grav Login Plugin
http://getgrav.org
MIT License
44 stars 54 forks source link

login.css usage based on route #273

Open pierrejoye opened 3 years ago

pierrejoye commented 3 years ago

Thank you for this plugin! great work!

While trying it together with the admin plugin, I see that login.css is added to all pages, systematically. I tracked it down to:

https://github.com/getgrav/grav-plugin-login/blob/134b6a77ef9ae993557c292a09f63c23cda997e4/login.php#L736

Should it not be based on: /admin and below ro

?

If the above is the desired goal, I can work on a PR. Not sure if that css is needed for anything else on every page as in my case, it is not at all, with my themes or other. But I may miss something :)

mahagr commented 3 years ago

The code says "not in admin and toggled on", so it is added to every page which is not in admin panel.

CSS should be probably in every page in case if you have login form in them. Or rather just turn it off and use your own CSS.

pierrejoye commented 3 years ago

Yeah, also I am not sure it makes sense to add it all the time but when the page is actually loaded. This is what assets functions are for, here it always adds it, no matter what :)