Created
July 5, 2014 23:52
-
-
Save proframework/79dd529afbbad4d84ea0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$name = md5(site_url()); | |
$name = substr($name, 0, 15); | |
if (!empty($_GET[$name . '-css']) == 'css') { | |
header('Content-Type: text/css'); | |
$generate_settings = get_option( 'generate_settings', generate_get_defaults() ); | |
$space = ' '; | |
// Start the magic | |
$visual_css = array ( | |
// Body CSS | |
'body' => array( | |
'background-color' => $generate_settings['background_color'], | |
'color' => $generate_settings['text_color'] | |
), | |
); | |
// Output the above CSS | |
$output = ''; | |
foreach($visual_css as $k => $properties) { | |
if(!count($properties)) | |
continue; | |
$temporary_output = $k . ' {'; | |
$elements_added = 0; | |
foreach($properties as $p => $v) { | |
if(empty($v)) | |
continue; | |
$elements_added++; | |
$temporary_output .= $p . ': ' . $v . '; '; | |
} | |
$temporary_output .= "}"; | |
if($elements_added > 0) | |
$output .= $temporary_output; | |
} | |
$output = str_replace(array("\r", "\n"), '', $output); | |
echo $output; | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment