当前位置: 首页>>代码示例>>PHP>>正文


PHP CSS::find_selectors方法代码示例

本文整理汇总了PHP中CSS::find_selectors方法的典型用法代码示例。如果您正苦于以下问题:PHP CSS::find_selectors方法的具体用法?PHP CSS::find_selectors怎么用?PHP CSS::find_selectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSS的用法示例。


在下文中一共展示了CSS::find_selectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse

 /**
  * The main processing function called by Scaffold. MUST return $css!
  *
  * @author Anthony Short
  * @return $css string
  */
 public static function parse()
 {
     global $bases;
     # This will store our nicely formated bases array
     # This lets us loop through all the of +mixins and just
     # pull in the properties of that mixin and then parse it individually
     # based on the parameters
     $bases = array();
     # Finds any selectors starting with =mixin-name
     if ($found = CSS::find_selectors('\\=(?P<name>[0-9a-zA-Z_-]*)(\\((?P<args>.*?)\\))?', 5)) {
         # Just to make life a little easier
         $full_base = $found[0];
         $base_names = $found['name'];
         $base_args = $found['args'];
         $base_props = $found['properties'];
         # Clean up memory
         unset($found);
         # Puts the mixin bases into a more suitable array
         foreach ($base_names as $key => $value) {
             $bases[$value]['properties'] = $base_props[$key];
             # If there are mixin arguments, add them
             $bases[$value]['params'] = $base_args[$key] != "" ? explode(',', $base_args[$key]) : array();
         }
         # Store this away for debugging
         self::$mixins = $bases;
         # Remove all of the mixin bases
         CSS::remove($full_base);
         # Clean up memory
         unset($full_base, $base_names, $base_args, $base_props);
         # Find the mixins
         if ($mixins = self::find_mixins(CSS::$css)) {
             # Loop through each of the found +mixins
             foreach ($mixins[2] as $mixin_key => $mixin_name) {
                 CSS::replace($mixins[0][$mixin_key], self::build_mixins($mixin_key, $mixins));
             }
             # Remove all of the +mixins (if they still exist)
             CSS::replace($mixins[0], '');
         }
         # Clean up
         unset($bases, $mixins);
     }
 }
开发者ID:robbenmu,项目名称:csscaffold,代码行数:48,代码来源:Mixins.php


注:本文中的CSS::find_selectors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。