예제 #1
0
 public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
 {
     $sArgs = $this->sArgs;
     if ($sArgs) {
         $sArgs = ' ' . $sArgs;
     }
     $sResult = "@{$this->sType}{$sArgs}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
     $sResult .= parent::render($oOutputFormat);
     $sResult .= '}';
     return $sResult;
 }
예제 #2
0
 public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat)
 {
     if (count($this->aSelectors) === 0) {
         // If all the selectors have been removed, this declaration block becomes invalid
         throw new OutputException("Attempt to print declaration block with missing selector");
     }
     $sResult = $oOutputFormat->implode($oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(), $this->aSelectors) . $oOutputFormat->spaceBeforeOpeningBrace() . '{';
     $sResult .= parent::render($oOutputFormat);
     $sResult .= '}';
     return $sResult;
 }