: Need a CSS framework that has variables and "mixins" I was using Less CSS but it creates too much duplication. Each HTML page I have includes 3 different stylesheets; two are common to all
I was using Less CSS but it creates too much duplication. Each HTML page I have includes 3 different stylesheets; two are common to all the pages (IE-support and 960 grid system) and the third stylesheet is a custom one made for that page. With Less CSS it was duplicating all the CSS code from the 960 grid system into the third stylesheet.
All I need are variables and functions/mixins/classes...basically a way to put duplicate CSS code in multiple spots.
More posts by @Phylliss660
2 Comments
Sorted by latest first Latest Oldest Best
It's quite straightforward to use a server-side language to roll your own CSS framework. Here's a basic example in PHP:
<?php
header('Content-Type: text/css');
$blue = '#00f';
$largeText = '24px';
?>
h1 {
font-size: <?=$largeText?>;
color: <?=$blue?>;
}
For mixins, you'd need to store the whole chunk of CSS in a string.
There are not enough words with which I can describe how awesome SASS is ... it is exactly what you are looking for. It even has a CSS3 superset mode. It is almost god.
And while you are investigating SASS, take a look at Compass (based on sass) - it has ready templates that you can use as mixins for your styles. It includes 960, Blueprint, YUI, and many others (some via plugins).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.