Lines Matching refs:decls
68 * @param css_declaration[] $decls
70 public function explode (&$decls) { argument
77 $this->explodeBackgroundShorthand ($decls);
80 $this->explodeFontShorthand ($decls);
83 $this->explodePaddingShorthand ($decls);
86 $this->explodeMarginShorthand ($decls);
89 $this->explodeBorderShorthand ($decls);
92 $this->explodeListStyleShorthand ($decls);
95 $this->explodeFlexShorthand ($decls);
98 $this->explodeTransitionShorthand ($decls);
101 $this->explodeOutlineShorthand ($decls);
104 $this->explodeAnimationShorthand ($decls);
107 $this->explodeBorderBottomShorthand ($decls);
110 $this->explodeColumnsShorthand ($decls);
113 $this->explodeColumnRuleShorthand ($decls);
149 * @param css_declaration[] $decls
151 protected function explodeBackgroundShorthand (&$decls) { argument
159 $decls [] = new css_declaration ('background-color', $value);
166 $decls [] = new css_declaration ('background-color', $value);
173 $decls [] = new css_declaration ('background-image', $values [$index]);
177 $decls [] = new css_declaration ('background-repeat', $values [$index]);
181 $decls [] = new css_declaration ('background-attachment', $values [$index]);
185 $decls [] = new css_declaration ('background-position', $values [$index]);
192 * @param css_declaration[] $decls
194 protected function explodeFontShorthand (&$decls, $setDefaults=false) { argument
213 $decls [] = new css_declaration ('font-style', $value);
218 $decls [] = new css_declaration ('font-style', 'normal');
234 $decls [] = new css_declaration ('font-variant', $value);
239 $decls [] = new css_declaration ('font-variant', 'normal');
266 $decls [] = new css_declaration ('font-weight', $value);
271 $decls [] = new css_declaration ('font-weight', 'normal');
295 $decls [] = new css_declaration ('font-size', $params [0]);
301 $decls [] = new css_declaration ('font-size', $params [0]);
309 $decls [] = new css_declaration ('font-size', 'medium');
315 $decls [] = new css_declaration ('line-height', $params [1]);
318 $decls [] = new css_declaration ('line-height', 'normal');
336 $decls [] = new css_declaration ('font-family', $font_family);
342 * @param css_declaration[] $decls
344 protected function explodePaddingShorthand (&$decls) { argument
349 $decls [] = new css_declaration ('padding-top', $values [0]);
350 $decls [] = new css_declaration ('padding-right', $values [1]);
351 $decls [] = new css_declaration ('padding-bottom', $values [2]);
352 $decls [] = new css_declaration ('padding-left', $values [3]);
355 $decls [] = new css_declaration ('padding-top', $values [0]);
356 $decls [] = new css_declaration ('padding-right', $values [1]);
357 $decls [] = new css_declaration ('padding-left', $values [1]);
358 $decls [] = new css_declaration ('padding-bottom', $values [2]);
361 $decls [] = new css_declaration ('padding-top', $values [0]);
362 $decls [] = new css_declaration ('padding-bottom', $values [0]);
363 $decls [] = new css_declaration ('padding-right', $values [1]);
364 $decls [] = new css_declaration ('padding-left', $values [1]);
367 $decls [] = new css_declaration ('padding-top', $values [0]);
368 $decls [] = new css_declaration ('padding-bottom', $values [0]);
369 $decls [] = new css_declaration ('padding-right', $values [0]);
370 $decls [] = new css_declaration ('padding-left', $values [0]);
377 * @param css_declaration[] $decls
379 protected function explodeMarginShorthand (&$decls) { argument
384 $decls [] = new css_declaration ('margin-top', $values [0]);
385 $decls [] = new css_declaration ('margin-right', $values [1]);
386 $decls [] = new css_declaration ('margin-bottom', $values [2]);
387 $decls [] = new css_declaration ('margin-left', $values [3]);
390 $decls [] = new css_declaration ('margin-top', $values [0]);
391 $decls [] = new css_declaration ('margin-right', $values [1]);
392 $decls [] = new css_declaration ('margin-left', $values [1]);
393 $decls [] = new css_declaration ('margin-bottom', $values [2]);
396 $decls [] = new css_declaration ('margin-top', $values [0]);
397 $decls [] = new css_declaration ('margin-bottom', $values [0]);
398 $decls [] = new css_declaration ('margin-right', $values [1]);
399 $decls [] = new css_declaration ('margin-left', $values [1]);
402 $decls [] = new css_declaration ('margin-top', $values [0]);
403 $decls [] = new css_declaration ('margin-bottom', $values [0]);
404 $decls [] = new css_declaration ('margin-right', $values [0]);
405 $decls [] = new css_declaration ('margin-left', $values [0]);
412 * @param css_declaration[] $decls
414 protected function explodeBorderShorthand (&$decls) { argument
429 $decls [] = new css_declaration ('border-width', $values [$index]);
431 … $decls [] = new css_declaration ($border_side.'-width', $values [$index]);
436 $decls [] = new css_declaration ('border-width', $values [$index]);
438 … $decls [] = new css_declaration ($border_side.'-width', $values [$index]);
461 $decls [] = new css_declaration ('border-style', $values [$index]);
463 … $decls [] = new css_declaration ($border_side.'-style', $values [$index]);
467 $decls [] = new css_declaration ('border-style', 'none');
469 $decls [] = new css_declaration ($border_side.'-style', 'none');
479 $decls [] = new css_declaration ('border-color', $values [$index]);
481 $decls [] = new css_declaration ($border_side.'-color', $values [$index]);
489 … $decls [] = new css_declaration ($border_side, $values [0].' '.$values [1].' '.$values [2]);
495 * @param css_declaration[] $decls
497 protected function explodeListStyleShorthand (&$decls) { argument
531 $decls [] = new css_declaration ('list-style-type', $value);
535 $decls [] = new css_declaration ('list-style-type', 'disc');
550 $decls [] = new css_declaration ('list-style-position', $value);
554 $decls [] = new css_declaration ('list-style-position', 'outside');
563 $decls [] = new css_declaration ('list-style-image', $value);
568 $decls [] = new css_declaration ('list-style-image', 'none');
574 * @param css_declaration[] $decls
576 protected function explodeFlexShorthand (&$decls) { argument
580 $decls [] = new css_declaration ('flex-grow', $values [0]);
583 $decls [] = new css_declaration ('flex-shrink', $values [1]);
586 $decls [] = new css_declaration ('flex-basis', $values [2]);
592 * @param css_declaration[] $decls
594 protected function explodeTransitionShorthand (&$decls) { argument
598 $decls [] = new css_declaration ('transition-property', $values [0]);
601 $decls [] = new css_declaration ('transition-duration', $values [1]);
604 $decls [] = new css_declaration ('transition-timing-function', $values [2]);
607 $decls [] = new css_declaration ('transition-delay', $values [3]);
613 * @param css_declaration[] $decls
615 protected function explodeOutlineShorthand (&$decls) { argument
624 $decls [] = new css_declaration ('outline-color', $value);
643 $decls [] = new css_declaration ('outline-style', $value);
647 $decls [] = new css_declaration ('outline-style', 'none');
663 $decls [] = new css_declaration ('outline-width', $value);
669 $decls [] = new css_declaration ('outline-width', $value);
676 $decls [] = new css_declaration ('outline-width', 'medium');
690 * @param css_declaration[] $decls
692 protected function explodeAnimationShorthand (&$decls) { argument
696 $decls [] = new css_declaration ('animation-name', $values [0]);
699 $decls [] = new css_declaration ('animation-duration', $values [1]);
702 $decls [] = new css_declaration ('animation-timing-function', $values [2]);
705 $decls [] = new css_declaration ('animation-delay', $values [3]);
708 $decls [] = new css_declaration ('animation-iteration-count', $values [4]);
711 $decls [] = new css_declaration ('animation-direction', $values [5]);
714 $decls [] = new css_declaration ('animation-fill-mode', $values [6]);
717 $decls [] = new css_declaration ('animation-play-state', $values [7]);
723 * @param css_declaration[] $decls
725 protected function explodeBorderBottomShorthand (&$decls) { argument
741 $decls [] = new css_declaration ('border-bottom-width', $value);
747 $decls [] = new css_declaration ('border-bottom-width', $value);
754 $decls [] = new css_declaration ('border-bottom-width', 'medium');
778 $decls [] = new css_declaration ('border-bottom-style', $value);
782 $decls [] = new css_declaration ('border-bottom-style', 'none');
791 $decls [] = new css_declaration ('border-bottom-color', $value);
800 * @param css_declaration[] $decls
802 protected function explodeColumnsShorthand (&$decls) { argument
806 $decls [] = new css_declaration ('column-width', 'auto');
807 $decls [] = new css_declaration ('column-count', 'auto');
811 $decls [] = new css_declaration ('column-width', $values [0]);
814 $decls [] = new css_declaration ('column-count', $values [1]);
820 * @param css_declaration[] $decls
822 protected function explodeColumnRuleShorthand (&$decls) { argument
826 $decls [] = new css_declaration ('column-rule-width', $values [0]);
829 $decls [] = new css_declaration ('column-rule-style', $values [1]);
832 $decls [] = new css_declaration ('column-rule-color', $values [2]);
932 public function __construct($selector, $decls, $media = NULL) { argument
939 $decls = trim ($decls, '{}');
943 $end = strlen ($decls);
945 $colon = strpos ($decls, ':', $pos);
949 $semi = strpos ($decls, ';', $colon + 1);
954 $property = substr ($decls, $pos, $colon - $pos);
957 $value = substr ($decls, $colon + 1, $semi - ($colon + 1));
1208 $decls = substr ($contents, $bracket_open + 1, $bracket_close - $bracket_open);
1213 $this->rules [] = new css_rule ($selector, $decls, $media);