/** * Finds any round(n) and rounds the number * to the nearest multiple of the baseline * * @author Anthony Short * @param $css */ private static function round_to_baseline($baseline) { if ($found = CSS::find_functions('round')) { foreach ($found[0] as $key => $match) { CSS::replace($match, round($found[1][$key] / $baseline) * $baseline . "px"); } } }
/** * Finds all url()'s that start with ~/ and replaces it * with the CSS url. * * @return void */ public static function replace_css_urls() { if ($found = CSS::find_functions('url')) { foreach ($found[1] as $url) { $url = unquote($url); if ($url[0] == "~") { self::replace($url, str_replace('~/', CSScaffold::config('core.url.css'), $url)); } } } }