I have 2 themes enabled on a Drupal 7 installation. The have one css file each included in their .info files:
sites/all/themes/themeA/css/screen.css sites/all/themes/themeB/css/screen.css
The default themeA is the default theme. Using hook_custom_theme, I'm setting the theme to themeB for a certain section of the website based on path. The theme changes successfully and the page renders using themeB when it should.
There is something strange that happens though and the css file from themeA loads as well, breaking parts of the page.
I am checking in hook_css_alter in themeB and there is no mention of themeA/css/screen.css. I am checking in hook_css_alter in themeA and it is never executed.
I have solved this by removing the file from themeA.info and adding it in themeA_css_alter(). I would prefer though and it would be interesting as well to find out why this happens, so that I can put back the the file inclusion where it should normally be.
Any insights?