I want to put snippets like these inside of a few php files and then require them in my main page, instead of using "pure" css and js files. I mean, I already do essentially this for my HTML DOM.
this:
<script type='text/javascript'>
var foo = <?php echo $bar; ?>;
</script>
or this:
<style type='text/css'>
.foo{
background-image:url('<?php echo $bar; ?>image.png');
}
</style>
is that really bad practice?
and, if it is, what are the pros and cons of such an approach?