I have a challenge with managing my CSS file in my Django app's static directory. I am using the same CSS file for multiple views, but I need certain elements to be customizable based on the specific page I am on.
Is it feasible to incorporate Django conditional statements like {% if request.path == ... %} within the static CSS file?
If not, what would be a more practical approach to achieve the desired outcome? For instance, the class header.masthead is repeated several times in the CSS file. It would be cumbersome to create new classes like header.mastheadcookiepage and duplicate the functionality across multiple pages.
Would it be possible to pass a variable from my views into the CSS file as a string? This way, I could dynamically change properties such as background image URL based on the current view.
While this may seem like a basic question, I am relatively new to web development and would appreciate any guidance or suggestions on how to address this issue effectively!