prop('width'); $flex = $this->prop('flex'); if(!empty($width)) { $basis = $width; if(is_numeric($width)) $basis = $width . 'px'; elseif(preg_match('/^(\d+)\/(\d+)$/', $width, $matches) !== 0) $basis = ((int)$matches[1] / (int)$matches[2] * 100) . '%'; } if(!empty($flex)) { if(strpos($flex, ' ') !== false) $style['flex'] = $flex; else $class[] = "flex-$flex"; } $style = array(); $style['order'] = $this->prop('order'); $style['flex-grow'] = $this->prop('grow'); $style['flex-shrink'] = $this->prop('shrink'); $style['flex-basis'] = $basis; $style['align-self'] = $this->prop('align'); return div ( setClass($class), setStyle($style), set($this->getRestProps()), $this->children() ); } }