Skip to content

Commit 7529c90

Browse files
author
ju1ius
committed
added methods for expanding and creating shorthand properties
1 parent c53c8b9 commit 7529c90

File tree

5 files changed

+546
-0
lines changed

5 files changed

+546
-0
lines changed

lib/CSSList.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,28 @@ public function getSelectorsBySpecificity($sSpecificitySearch = null) {
152152
$this->allSelectors($aResult, $sSpecificitySearch);
153153
return $aResult;
154154
}
155+
156+
/**
157+
* Expands all shorthand properties to their long value
158+
*/
159+
public function expandShorthands()
160+
{
161+
foreach($this->getAllDeclarationBlocks() as $oDeclaration)
162+
{
163+
$oDeclaration->expandShorthands();
164+
}
165+
}
166+
167+
/*
168+
* Create shorthands properties whenever possible
169+
*/
170+
public function createShorthands()
171+
{
172+
foreach($this->getAllDeclarationBlocks() as $oDeclaration)
173+
{
174+
$oDeclaration->createShorthands();
175+
}
176+
}
155177
}
156178

157179
/**

0 commit comments

Comments
 (0)