本文整理汇总了PHP中SassNode类的典型用法代码示例。如果您正苦于以下问题:PHP SassNode类的具体用法?PHP SassNode怎么用?PHP SassNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SassNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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;
}
}
return join(', ', $selectors);
}
开发者ID:sohailaammarocs,项目名称:lfc,代码行数:15,代码来源:SassCompactRenderer.php
示例4: isChildOf
/**
* Returns a value indicating if this node is a child of the passed node.
* This just checks the levels of the nodes. If this node is at a greater
* level than the passed node if is a child of it.
*
* @param SassNode $node
*
* @return boolean true if the node is a child of the passed node, false if not
*/
public function isChildOf($node)
{
return $this->getLevel() > $node->getLevel();
}
开发者ID:richthegeek,项目名称:phpsass,代码行数:13,代码来源:SassNode.php
示例5: __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
示例6: __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
示例7: __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
示例8: __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
示例9: __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
示例10: __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
示例11: __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
示例12: __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
示例13: __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
示例14: __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
示例15: __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
示例16: __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
示例17: __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
示例18: __construct
/**
* SassForNode constructor.
*
* @param
* object source token
* @return SassForNode
*/
public function __construct($token)
{
parent::__construct($token);
if (!preg_match(self::MATCH, $token->source, $matches)) {
throw new SassForNodeException('Invalid {what}', array('{what}' => '@for directive'), $this);
}
$this->variable = $matches[self::VARIABLE];
$this->from = $matches[self::FROM];
$this->to = $matches[self::TO];
$this->inclusive = $matches[self::INCLUSIVE] === SassForNode::IS_INCLUSIVE;
$this->step = empty($matches[self::STEP]) ? 1 : $matches[self::STEP];
}
开发者ID:quanict,项目名称:giaF,代码行数:19,代码来源:SassForNode.php
示例19: __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];
if (!isset($matches[self::VALUE])) {
$this->value = '';
} else {
$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));
}
}
$this->important = trim(array_pop($matches)) == '!important';
}
开发者ID:edwardchan,项目名称:d8-drupalvm,代码行数:21,代码来源:SassPropertyNode.php
示例20: __construct
/**
* SassMixinDefinitionNode constructor.
* @param object source token
* @return SassMixinDefinitionNode
*/
public function __construct($token)
{
// if ($token->level > 1) {
// throw new SassMixinDefinitionNodeException('Mixins can only be defined at root level. Token was set at level ' . $token->level, $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]);
}
}
开发者ID:helpfulrobot,项目名称:unclecheese-meta-languages,代码行数:20,代码来源:SassMixinDefinitionNode.php
注:本文中的SassNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论