Liberate CSS
dkruglyak - October 31, 2007 - 08:27
| Project: | Drupal for Facebook |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Right now Facebook stylesheets are stored in styles.tpl.php file. This is a lousy way to keep stylesheets, since this makes them impossible to manage with typical editors. Stylesheets should be stored a CSS file, included with a statement like this:
$output .= '<style>'.file_get_contents("fb_styles.css", true).'</style>';Realistically, FB CSS needs to be customized for apps of any sophistication.

#1
Personally, I think its an improvement that a CSS file can have dynamic content, even if it doesn't use it yet. What makes CSS files special that they have to be static, while nodes, pages, and other elements can be dynamic?
But you're free to replace the fb_fbml theme with anything you prefer. Just like you can replace garland with any other theme. I recommend you do something like this, at the end of your settings.php after you include settings.inc:
<?phpif ((isset($_REQUEST['fb_sig'])) {
// It's a facebook canvas page
$conf['admin_theme'] = 'MY_THEME';
$conf['fb_theme'] = 'MY_THEME';
}
?>
#2
Agreed, there is value in having dynamic CSS, however most FB CSS is naturally static.
Why not include two files? Baseline static first and then dynamic for any app-specific customizations next?
Baseline FB theme should be made easy to customize...