Closed rocchidavide closed 9 years ago
You can print the class of the page with <?php echo $GLOBALS['objPage']->cssClass ?>
in a template.
But you could solve it also with CSS only. Assuming a body class dark-version
and the header class page-header
you could write something like this:
.page-header {
color: black;
background: white;
}
.dark-version .page-header {
color: white;
background: black;
}
Please note that your question isn’t related to the Custom Elements extension.
I knew the css inheritance method, but i'm mounting a bought theme, so I'm trying to use only the source styles. Ah, Custom Elements is so useful and flexible to do the job ;)
Thank you very much ausi, and sorry for the low relevancy of my question.
Is it possible to get the css of the body tag from inside an rsce_ template? I made with rsce the header of a website and I would like to change header appareance (dark or light) for every page by setting a class in the body field. The idea is to avoid Contao layout duplication for only a header class to set. Oh, obviously any other smarter idea is welcome :) Thank you