GrooveOnBeat Posted July 24, 2016 Share Posted July 24, 2016 As I add conditionals in the HTML templates, is there a way to add those conditionals in the CSS files? Or conditionals can only work in HTML templates? Link to comment Share on other sites More sharing options...
Rikki Posted July 24, 2016 Share Posted July 24, 2016 Yes, you can use logic in CSS files Link to comment Share on other sites More sharing options...
GrooveOnBeat Posted July 24, 2016 Author Share Posted July 24, 2016 7 minutes ago, Rikki said: Yes, you can use logic in CSS files I must have done it wrong then. So something like this should work? {{if \IPS\Dispatcher::i()->application->directory == 'forums' and \IPS\Dispatcher::i()->module->key == 'forums' and \IPS\Dispatcher::i()->controller == 'forums' and in_array(\IPS\Request::i()->id, array(1,2,3))}} Link to comment Share on other sites More sharing options...
Rikki Posted July 24, 2016 Share Posted July 24, 2016 Ah, no, that won't because CSS files are compiled down when saved, so you can't write logic that depends on anything happening per-page. You can do something like this: {{if theme.rounded_photos}} ...for example. Link to comment Share on other sites More sharing options...
GrooveOnBeat Posted July 24, 2016 Author Share Posted July 24, 2016 23 minutes ago, Rikki said: Ah, no, that won't because CSS files are compiled down when saved, so you can't write logic that depends on anything happening per-page. You can do something like this: {{if theme.rounded_photos}} ...for example. Let's say I wanted to call up CSS classes based on the page, member, member group, etc., am I then restricted within templates or blocks? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.