3 ms·
Why Sass indeed, when all that can be done with Sass, can be done with plain old PHP? Example: style.css.php <?php header('Content-Type: text/css');
by tomcdonnell 13y ago
Why Sass indeed, when all that can be done with Sass, can be done with plain old PHP?
Example: style.css.php
<?php
header('Content-Type: text/css');
$brandColor = "#fc3;\n";
$defaultStyles = <<<STR
margin-bottom: 20px;
font-size: 14px;
line-height: 1.5;\n
STR;
?>
a {
color: <?php echo $brandColor; ?>
}
nav {
background-color: <?php echo $brandColor; ?>
}
p {
<?php echo $defaultStyles; ?>
}
footer {
<?php echo $defaultStyles; ?>
}
- krapp 13y agoThis makes it impossible to deal with the CSS without also having to deal with server-side coding, though.