當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SassNode類代碼示例

本文整理匯總了PHP中SassNode的典型用法代碼示例。如果您正苦於以下問題:PHP SassNode類的具體用法?PHP SassNode怎麽用?PHP SassNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SassNode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderSelectors

 /**
  * Renders rule selectors.
  * @param SassNode $node the node being rendered
  * @return string the rendered selectors
  */
 protected function renderSelectors($node)
 {
     $selectors = array();
     foreach ($node->selectors as $selector) {
         if (!$node->isPlaceholder($selector)) {
             $selectors[] = $selector;
         }
     }
     $indent = $this->getIndent($node);
     return $indent . join(",\n{$indent}", $selectors);
 }
開發者ID:richthegeek,項目名稱:phpsass,代碼行數:16,代碼來源:SassNestedRenderer.php

示例2: __construct

 /**
  * Root SassNode constructor.
  * @param SassParser Sass parser
  * @return SassNode
  */
 public function __construct($parser)
 {
     parent::__construct((object) array('source' => '', 'level' => -1, 'filename' => $parser->filename, 'line' => 0));
     $this->parser = $parser;
     $this->script = new SassScriptParser();
     $this->renderer = SassRenderer::getRenderer($parser->style);
     $this->root = $this;
 }
開發者ID:nizsheanez,項目名稱:kur.ru,代碼行數:13,代碼來源:SassRootNode.php

示例3: __construct

 /**
  * SassWhileNode constructor.
  * @param object source token
  * @return SassWhileNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     preg_match(self::MATCH, $token->source, $matches);
     $this->expression = $matches[self::EXPRESSION];
     $this->isDo = $matches[self::LOOP] === SassWhileNode::IS_DO;
 }
開發者ID:robin7788,項目名稱:hrmtest,代碼行數:12,代碼來源:SassWhileNode.php

示例4: __construct

 /**
  * SassMediaNode.
  * @param object source token
  * @param mixed string: an internally generated warning message about the
  * source
  * boolean: the source token is a @Media or @warn directive containing the
  * message; True if this is a @warn directive
  * @param array parameters for the message
  * @return SassMediaNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     preg_match(self::MATCH, $token->source, $matches);
     $this->token = $token;
     $this->media = $matches[self::MEDIA];
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:17,代碼來源:SassMediaNode.php

示例5: __construct

 /**
  * SassContentNode constructor.
  * @param object source token
  * @return SassContentNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     preg_match(self::MATCH, $token->source, $matches);
     if (empty($matches)) {
         return new SassBoolean('false');
     }
 }
開發者ID:helpfulrobot,項目名稱:unclecheese-meta-languages,代碼行數:13,代碼來源:SassContentNode.php

示例6: __construct

 /**
  * SassImportNode.
  * 
  * @param
  *        	object source token
  * @return SassImportNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     preg_match(self::MATCH, $token->source, $matches);
     foreach (explode(',', $matches[self::FILES]) as $file) {
         $this->files[] = trim($file);
     }
 }
開發者ID:quanict,項目名稱:giaF,代碼行數:15,代碼來源:SassImportNode.php

示例7: __construct

 /**
  * SassImportNode.
  * @param object $token source token
  * @return SassImportNode
  */
 public function __construct($token, $parent)
 {
     parent::__construct($token);
     $this->parent = $parent;
     preg_match(self::MATCH, $token->source, $matches);
     foreach (SassList::_build_list($matches[self::FILES]) as $file) {
         $this->files[] = trim($file, '"\'; ');
     }
 }
開發者ID:richthegeek,項目名稱:phpsass,代碼行數:14,代碼來源:SassImportNode.php

示例8: __construct

 /**
  * SassReturnNode constructor.
  * @param object $token source token
  * @return SassReturnNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     preg_match(self::MATCH, $token->source, $matches);
     if (empty($matches)) {
         return new SassBoolean('false');
     }
     $this->statement = $matches[self::STATEMENT];
 }
開發者ID:richthegeek,項目名稱:phpsass,代碼行數:14,代碼來源:SassReturnNode.php

示例9: __construct

 /**
  * SassMixinDefinitionNode constructor.
  * @param object source token
  * @return SassMixinNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     preg_match(self::MATCH, $token->source, $matches);
     $this->name = $matches[self::NAME];
     if (isset($matches[self::ARGS])) {
         $this->args = SassScriptFunction::extractArgs($matches[self::ARGS]);
     }
 }
開發者ID:randomblast,項目名稱:phamlp,代碼行數:14,代碼來源:SassMixinNode.php

示例10: __construct

 /**
  * SassPropertyNode constructor.
  * @param object source token
  * @param string property syntax
  * @return SassPropertyNode
  */
 public function __construct($token, $syntax = 'new')
 {
     parent::__construct($token);
     $matches = self::match($token, $syntax);
     $this->name = $matches[self::NAME];
     $this->value = $matches[self::VALUE];
     if ($matches[self::SCRIPT] === self::IS_SCRIPT) {
         $this->addWarning('Setting CSS properties with "=" is deprecated; use "{name}: {value};"', array('{name}' => $this->name, '{value}' => $this->value));
     }
 }
開發者ID:randomblast,項目名稱:phamlp,代碼行數:16,代碼來源:SassPropertyNode.php

示例11: __construct

 /**
  * SassEachNode constructor.
  * @param object source token
  * @return SassEachNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     if (!preg_match(self::MATCH, $token->source, $matches)) {
         throw new SassEachNodeException('Invalid @each directive', $this);
     } else {
         $this->variable = trim($matches[self::VARIABLE]);
         $this->in = $matches[self::IN];
     }
 }
開發者ID:helpfulrobot,項目名稱:unclecheese-meta-languages,代碼行數:15,代碼來源:SassEachNode.php

示例12: __construct

 /**
  * SassIfNode constructor.
  * @param object source token
  * @param boolean true for an "if" node, false for an "else if | else" node
  * @return SassIfNode
  */
 public function __construct($token, $if = true)
 {
     parent::__construct($token);
     if ($if) {
         preg_match(self::MATCH_IF, $token->source, $matches);
         $this->expression = $matches[SassIfNode::IF_EXPRESSION];
     } else {
         preg_match(self::MATCH_ELSE, $token->source, $matches);
         $this->expression = sizeof($matches) == 1 ? null : $matches[SassIfNode::ELSE_EXPRESSION];
     }
 }
開發者ID:blindest,項目名稱:Yii-CMS-2.0,代碼行數:17,代碼來源:SassIfNode.php

示例13: __construct

 /**
  * SassMixinDefinitionNode constructor.
  * @param object source token
  * @return SassMixinNode
  */
 public function __construct($token)
 {
     parent::__construct($token);
     preg_match(self::MATCH, $token->source, $matches);
     if (!isset($matches[self::NAME])) {
         throw new SassMixinNodeException('Invalid mixin invocation: ($token->source)', $this);
     }
     $this->name = $matches[self::NAME];
     if (isset($matches[self::ARGS]) && strlen($matches[self::ARGS])) {
         $this->args = $matches[self::ARGS];
     }
 }
開發者ID:edwardchan,項目名稱:d8-drupalvm,代碼行數:17,代碼來源:SassMixinNode.php

示例14: __construct

 /**
  * SassMixinDefinitionNode constructor.
  * @param object source token
  * @return SassMixinDefinitionNode
  */
 public function __construct($token)
 {
     preg_match(self::MATCH, $token->source, $matches);
     parent::__construct($token);
     if (empty($matches)) {
         throw new SassMixinDefinitionNodeException('Invalid Mixin', $this);
     }
     $this->name = $matches[self::NAME];
     if (isset($matches[self::ARGUMENTS])) {
         $this->args = SassScriptFunction::extractArgs($matches[self::ARGUMENTS], true, new SassContext());
     }
 }
開發者ID:robin7788,項目名稱:hrmtest,代碼行數:17,代碼來源:SassMixinDefinitionNode.php

示例15: __construct

 /**
  * SassDebugNode.
  * @param object source token
  * @param mixed string: an internally generated warning message about the
  * source
  * boolean: the source token is a @debug or @warn directive containing the
  * message; True if this is a @warn directive
  * @param array parameters for the message
  * @return SassDebugNode
  */
 public function __construct($token, $message = false)
 {
     parent::__construct($token);
     if (is_string($message)) {
         $this->message = $message;
         $this->warning = true;
     } else {
         preg_match(self::MATCH, $token->source, $matches);
         $this->message = $matches[self::MESSAGE];
         $this->warning = $message;
     }
 }
開發者ID:watsonad,項目名稱:gpoa,代碼行數:22,代碼來源:SassDebugNode.php


注:本文中的SassNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。