4

I'm working on an Expression Engine module and would like to have some custom CSS in the control panel just for my module. I really don't want to have to use a theme and an override.css file. I also wanted to separate the CSS and did not want to have to place it in an '$this->EE->cp->add_to_head()' call. Is it possible to place it in a file in my module folder like the view and js files?

1 Answers1

13

Yup. Put it in /third_party/my_module/css/my_styles.css, then in your view file call:

$this->EE->cp->load_package_css('my_styles');
Derek Hogue
  • 4,589
  • 1
  • 15
  • 27
  • Whoa. Did not know that was possible (only know about the JS version). Is it documented anywhere? – Adrian Macneil Nov 17 '12 at 12:14
  • 1
    Why would it be documented? That would make it far too useful. :P Alas, it is not, not that I can find anyway. – Derek Hogue Nov 17 '12 at 14:42
  • 1
    Awesome Adrian. Thank you, I will give that a try. In general the lack of good documentation is making it very tricky for me to develop add-ons with any sort of efficiency. Thank goodness for the awesome EE community otherwise it would be impossible. – Adam Christianson Nov 19 '12 at 14:54