Adds classes or merges them on to array of existing CSS classes.

@param string|array ...
CSS classes to add to the class attribute array.

@return $this
769816
public function addClass() {
    $args = func_get_args();
    if ($args) {
      $classes = array();
      foreach ($args as $arg) {
        // Merge the values passed in from the classes array.
        // The argument is cast to an array to support comma separated single
        // values or one or more array arguments.
        $classes = array_merge($classes, (array) $arg);
      }

      // Merge if there are values, just add them otherwise.
      if (isset($this->storage['class']) && $this->storage['class'] instanceof AttributeArray) {
        // Merge the values passed in from the class value array.
        $classes = array_merge($this->storage['class']->value(), $classes);
        $this->storage['class']->exchangeArray($classes);
      }
      else {
        $this->offsetSet('class', $classes);
      }
    }

    return $this;
  }
840799
public function addClass($class) {

		// classes array
		if (is_array($class)) {
			
			// adds all of them
			foreach ($class as $c) {
				if (!in_array($c, $this->class)) {
					$this->class[] = $c;
				}
			}
			
		// single class
		} else if (!in_array($class, $this->class)) {
			
			$this->class[] = $class;
			
		}

		return $this;

	}
618861
public function includeDefaultCssFiles()
    {
        foreach ($this->cssFiles as $file) {
            $filePath = StringService::get()->getExtensionRelativePath('Resources/Public/StyleSheets/' . $file);

            $this->assetHandlerConnectorManager
                ->getPageRenderer()
                ->addCssFile($filePath);
        }

        return $this;
    }
809196
public function wrapperClass($classes = [])
    {
        $classes = !is_array($classes) ? explode(' ', $classes) : $classes;
        $classes[] = 'wrapper';
        $classes[] = sprintf('template-%s', $this->template);

        if (is_active_sidebar(sprintf('sidebar-%s', $this->template))) {
            $classes[] = 'active-sidebar';
        }

        if (has_nav_menu('main-menu')) {
            $classes[] = 'active-main-menu';
        }

        if (is_active_sidebar('header-widgets')) {
            $classes[] = 'active-header-widgets';
        }

        $i = 0;
        if (is_active_sidebar('footer-one')) $i++;
        if (is_active_sidebar('footer-two')) $i++;
        if (is_active_sidebar('footer-three')) $i++;
        if (is_active_sidebar('footer-four')) $i++;

        switch ($i) {
            case 1:
                $classes[] = 'active-footers-one';
                break;
            case 2:
                $classes[] = 'active-footers-two';
                break;
            case 3:
                $classes[] = 'active-footers-three';
                break;
            case 4:
                $classes[] = 'active-footers-four';
                break;
            default:
                break;
        }

        $classes = apply_filters('novusopress_view_wrapper_classes', $classes);
        $output = sprintf('class="%s"', implode(' ', $classes));

        return apply_filters('novusopress_view_wrapper_class_output', $output);
    }
522375
public function setClasses( $classes )
	{
		$this->attributes['class']	= array();
		if( is_string( $classes ) )
			$classes	= explode( " ", $classes );
		if( !is_array( $classes ) && !( $classes instanceof ArrayIterator ) )
			throw new InvalidArgumentException( 'Class attribute must be string, array or iterator' );
		foreach( $classes as $class )
			$this->addClass( $class );
	}
1026837
public function attachPearPrefixes(array $classes)
    {
        foreach ($classes as $prefix => $paths) {
            $this->attachPearPrefix($prefix, $paths);
        }
        return $this;
    }
226679
public function addClass( string $class ): Tag
    {

        if ( ! isset( $this->attributes['class'] ) ) {
            $this->attributes['class'] = $class;
        } else {
            $this->attributes['class'] .= " $class";
        }

        return $this;
    }
895600
public function setClasses($classes)
    {
        if (!\is_array($classes)) {
            $classes = \explode(' ', $classes);
        }
        $this->classes = $classes;

        return $this;
    }
725687
public function addStyles(array $styles)
    {
        if (!$this->styleSet) {
            $this->styleSet = new DefaultStyleSet();
        }

        $this->styleSet->merge($styles);

        return $this;
    }
146641
public function setClassAttr($classes)
    {
        if (is_array($classes)) {
            $classes = implode(' ', $classes);
        }

        $this->classAttr = $classes;

        return $this;
    }
173239
public function addClass($class)
    {
        if (is_array($class)) {
            $class = implode(' ', $class);
        }

        if (!$this->class) {
            $this->class = [];
        }

        if (is_string($this->class)) {
            throw new Exception(['Property $class should always be array', 'object' => $this, 'class' => $this->class]);
        }

        $this->class = array_merge($this->class, explode(' ', $class));

        return $this;
    }
256095
public function addClass($class)
    {
        if (! $this->hasClass($class)) {
            $this->set('class', trim((string) $this->get('class') . ' ' . $class));
        }

        return $this;
    }
979787
public function &inline($styles)
    {
        $css_object = new CssObject();

        $css_object->setType('inline');
        $css_object->setCss($styles);

        $this->add($css_object);

        return $css_object;
    }
401202
function addClass( element, cssClass ) {
   if( element.classList ) {
      element.classList.add( cssClass );
      return;
   }
   element.className += ` ${cssClass}`;
}
160133
public function addFormGroupCssClass($cssClass)
    {
        $cssClass = array_merge($this->formGroupCssClass, $this->parseCssClasses($cssClass));
        $this->formGroupCssClass = array_unique($cssClass);
        return $this;
    }
558866
public function import_classes( $data ) {
		if ( is_array($data) ) {
			$data = (object) $data;
		}
		$this->classes = array_merge($this->classes, $data->classes);
		$this->classes = array_unique($this->classes);
		$this->classes = apply_filters('nav_menu_css_class', $this->classes, $this, array(), 0);
		$this->class = trim(implode(' ', $this->classes));
	}
596462
public function addElementClass($class)
    {
        if (is_array($class) || is_string($class)) {
            $this->elementClass = array_merge($this->elementClass, (array) $class);

            $this->elementClass = array_unique($this->elementClass);
        }

        return $this;
    }