本文整理汇总了PHP中CSS::append方法的典型用法代码示例。如果您正苦于以下问题:PHP CSS::append方法的具体用法?PHP CSS::append怎么用?PHP CSS::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSS
的用法示例。
在下文中一共展示了CSS::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse_grid
/**
* The pre-processing function occurs after the importing,
* but before any real processing. This is usually the stage
* where we set variables and the like, getting the css ready
* for processing.
*
* @author Anthony Short
* @param $css
*/
public static function parse_grid()
{
# Find the @grid - this returns an array of 'groups' and 'values'
if ($settings = CSS::find_at_group('grid')) {
# All the @grids
$groups = $settings['groups'];
# Store it so it's easier to grab
$settings = $settings['values'];
# Make sure none of the required options are missing
foreach (array('column-count', 'column-width') as $option) {
if (!isset($settings[$option])) {
throw new Scaffold_Exception('Layout module requires the column-count and column-width properties');
}
}
# Remove it from the css
CSS::replace($groups, array());
# The number of columns, baseline and unit
$cc = $settings['column-count'];
$unit = isset($settings['unit']) ? $settings['unit'] : 'px';
$bl = isset($settings['baseline']) ? $settings['baseline'] : 18;
$cw = $settings['column-width'];
# Get the gutters
$lgw = isset($settings['left-gutter-width']) ? $settings['left-gutter-width'] : 0;
$rgw = isset($settings['right-gutter-width']) ? $settings['right-gutter-width'] : 0;
# Get the total gutter width
$gw = $settings['gutter-width'] = $lgw + $rgw;
# The total grid width
$grid = ($cw + $gw) * $cc;
$grid_settings = array('column-count' => $cc, 'column-width' => $cw . $unit, 'gutter-width' => $gw . $unit, 'left-gutter-width' => $lgw . $unit, 'right-gutter-width' => $rgw . $unit, 'grid-width' => $grid . $unit, 'baseline' => $bl . $unit);
# Set them as constants we can use in the css
foreach ($grid_settings as $key => $value) {
Constants::set($key, $value);
}
# Path to the image
$img = CSScaffold::config('core.path.cache') . "Layout/{$lgw}_{$cw}_{$rgw}_{$bl}_grid.png";
# Generate the grid.png
self::create_grid_image($cw, $bl, $lgw, $rgw, $img);
$img = str_replace(CSScaffold::config('core.path.docroot'), '/', $img);
CSS::append(".showgrid{background:url('" . $img . "');}");
# Round to baselines
self::round_to_baseline($bl);
# Make each of the column variables a member variable
self::$column_count = $cc;
self::$column_width = $cw;
self::$gutter_width = $gw;
self::$left_gutter_width = $lgw;
self::$right_gutter_width = $rgw;
self::$grid_width = $grid;
self::$baseline = $bl;
}
}
示例2: import_mixins
/**
* Import mixins
*
* @author Anthony Short
* @return string
*/
public static function import_mixins($dir)
{
if ($mixin_files = CSScaffold::list_files($dir, true)) {
foreach ($mixin_files as $item) {
if (!is_css($item)) {
continue;
}
# Add it to our css
CSS::append(file_get_contents($item));
}
} else {
throw new Scaffold_Exception('Cannot find the mixin directory - ' . $dir);
}
}