Skip to content

Commit 30b76fe

Browse files
committed
added @namespace rule support
1 parent 71f8d37 commit 30b76fe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/Sabberworm/CSS/Parser.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ private function parseAtRule() {
110110
$this->consume(';');
111111
$this->setCharset($sCharset->getString());
112112
return new Charset($sCharset);
113+
} else if ($sIdentifier === 'namespace') {
114+
$this->consumeWhiteSpace();
115+
116+
if ($this->comes('"')) {
117+
$prefix = "";
118+
$namespace = $this->parseStringValue()->getString();
119+
120+
}else{
121+
$prefix = $this->parseIdentifier(false);
122+
$this->consumeWhiteSpace();
123+
$namespace = $this->parseStringValue()->getString();
124+
}
125+
$this->consume(';');
126+
return new CssNamespace($namespace, $prefix);
113127
} else {
114128
//Unknown other at rule (font-face or such)
115129
$this->consume('{');

0 commit comments

Comments
 (0)