doublesecretagency / craft-cpcss

Control Panel CSS plugin for Craft CMS
MIT License
117 stars 8 forks source link

Using a Twig template/front-end URL for a CSS File #17

Closed jrrdnx closed 2 years ago

jrrdnx commented 2 years ago

Potentially related to #16, but I can't seem to get the path to a front-end URL or template working when listed in the CSS File(s) field.

I currently have a custom plugin generating CSS custom variables, and using variables to output them to the main wrapper. I've moved this its own template which loads successfully and outputs the processed Twig variables, but this content is not included in the CP CSS.

CSS File(s) field value:

@web/styleGuide,@web/dist/css/redactor.css

The redactor.css file is working properly, but the /styleGuide content is not being included. Any ideas?

jrrdnx commented 2 years ago

I had a little more time to look into this today and noticed that, even though direct requests to /styleGuide were working properly, in the control panel it was returning 503. This may or may not be due to (what I thought were unrelated) issues I'm currently having on my local environment.

I also added {% header "Content-Type: text/css" %} to the template around the same time it started working, so that may have had something to do with it as well.

Thanks for a great plugin!

lindseydiloreto commented 2 years ago

Ok great, glad you got it sorted out! 👍