[imp] Improve the "Is debug" check for the templates

### Tracker



### How to test
1. enable debug
2. make sure that the debug css is load if debug is on for all templates.